Skip to content

Commit

Permalink
Don't drop "binary" and "profile" capabilities for Marionette.
Browse files Browse the repository at this point in the history
Those are supposed to be sent over to Geckodriver.
  • Loading branch information
juangj committed Jul 28, 2016
1 parent 5fb1cfc commit f233563
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions java/client/src/org/openqa/selenium/firefox/FirefoxDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ public FirefoxDriver(GeckoDriverService driverService, Capabilities desiredCapab
private FirefoxDriver(CommandExecutor executor, Capabilities desiredCapabilities,
Capabilities requiredCapabilities) {
super(executor,
dropCapabilities(desiredCapabilities, BINARY, PROFILE),
dropCapabilities(requiredCapabilities, BINARY, PROFILE));
dropCapabilities(desiredCapabilities),
dropCapabilities(requiredCapabilities));
}

private static final CommandExecutor createCommandExecutor(Capabilities desiredCapabilities,
Expand Down Expand Up @@ -351,16 +351,23 @@ protected void stopClient(Capabilities desiredCapabilities, Capabilities require
* Used for capabilities which aren't BeanToJson-convertable, and are only used by the local
* launcher.
*/
private static Capabilities dropCapabilities(Capabilities capabilities, String... keysToRemove) {
private static Capabilities dropCapabilities(Capabilities capabilities) {
if (capabilities == null) {
return new DesiredCapabilities();
}
final Set<String> toRemove = Sets.newHashSet(keysToRemove);
DesiredCapabilities caps = new DesiredCapabilities(Maps.filterKeys(capabilities.asMap(), new Predicate<String>() {
public boolean apply(String key) {
return !toRemove.contains(key);
}
}));

DesiredCapabilities caps;

if (isLegacy(capabilities)) {
final Set<String> toRemove = Sets.newHashSet(BINARY, PROFILE);
caps = new DesiredCapabilities(Maps.filterKeys(capabilities.asMap(), new Predicate<String>() {
public boolean apply(String key) {
return !toRemove.contains(key);
}
}));
} else {
caps = new DesiredCapabilities(capabilities);
}

// Ensure that the proxy is in a state fit to be sent to the extension
Proxy proxy = Proxy.extractFrom(capabilities);
Expand Down

0 comments on commit f233563

Please sign in to comment.