Skip to content

Commit

Permalink
Make firefox matching more exact
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Jun 27, 2018
1 parent d9de47c commit eb3e5f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
Expand Up @@ -132,6 +132,10 @@ public Builder(FirefoxBinary binary) {
public int score(Capabilities capabilites) {
int score = 0;

if (capabilites.getCapability(FirefoxDriver.MARIONETTE) == Boolean.FALSE) {
return 0; // We're not meant for this one.
}

if (BrowserType.FIREFOX.equals(capabilites.getBrowserName())) {
score++;
}
Expand All @@ -141,9 +145,6 @@ public int score(Capabilities capabilites) {
}

// This is the legacy firefox driver that they've asked for.
if (capabilites.getCapability(FirefoxDriver.MARIONETTE) == Boolean.FALSE) {
score--;
}

return score;
}
Expand Down
Expand Up @@ -249,22 +249,7 @@ public static class Builder extends DriverService.Builder<XpiDriverService, XpiD

@Override
public int score(Capabilities capabilites) {
int score = 0;

if (BrowserType.FIREFOX.equals(capabilites.getBrowserName())) {
score++;
}

if (capabilites.getCapability(FirefoxOptions.FIREFOX_OPTIONS) != null) {
score++;
}

// This is the legacy firefox driver that they've asked for. Bind very strongly.
if (capabilites.getCapability(FirefoxDriver.MARIONETTE) == Boolean.FALSE) {
score += 5;
}

return score;
return capabilites.getCapability(FirefoxDriver.MARIONETTE) == Boolean.FALSE ? 5 : 0;
}

public Builder withBinary(FirefoxBinary binary) {
Expand Down

0 comments on commit eb3e5f2

Please sign in to comment.