Skip to content

Commit

Permalink
don't replace a platform specified to the add browser method, like th…
Browse files Browse the repository at this point in the history
…e TODO says
  • Loading branch information
lukeis committed Aug 31, 2015
1 parent 32d519e commit 7e14836
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,9 @@ public void deleteAllBrowsers() {
nodeConfig.getCapabilities().clear();
}

// TODO freynaud keep specified platform if specified. At least for unit test purpose.
/**
* Adding the browser described by the capability, automatically finding out what platform the
* node is launched from ( and overriding it if it was specified )
* node is launched from
*
* @param cap describing the browser
* @param instances number of times this browser can be started on the node.
Expand All @@ -164,7 +163,9 @@ public void addBrowser(DesiredCapabilities cap, int instances) {
if (s == null || "".equals(s)) {
throw new InvalidParameterException(cap + " does seems to be a valid browser.");
}
cap.setPlatform(Platform.getCurrent());
if (cap.getPlatform() == null) {
cap.setPlatform(Platform.getCurrent());
}
cap.setCapability(RegistrationRequest.MAX_INSTANCES, instances);
nodeConfig.getCapabilities().add(cap);
}
Expand Down

0 comments on commit 7e14836

Please sign in to comment.