Skip to content

Commit

Permalink
Fixes to FirefoxOptions.java (SeleniumHQ#3327)
Browse files Browse the repository at this point in the history
* Fixes to FirefoxOptions.java

- Remove unneeded check for both prefs and profile being present:
  According to mozilla/geckodriver#421
  having both is valid.
- Add getProfile method:
  Allows for use in intermediate nodes that need to modify the profile
  e.g. to add additional certs or extensions.

* Fix type error.
  • Loading branch information
DrMarcII authored and lukeis committed Jan 8, 2017
1 parent 45cf95f commit a4e5719
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ public FirefoxOptions setProfile(FirefoxProfile profile) {
return this;
}

public FirefoxProfile getProfile() {
return this.profile;
}

// Confusing API. Keeping package visible only
FirefoxOptions setProfileSafely(FirefoxProfile profile) {
if (profile == null) {
Expand Down Expand Up @@ -183,11 +187,6 @@ public DesiredCapabilities addTo(DesiredCapabilities capabilities) {

Object priorProfile = capabilities.getCapability(PROFILE);
if (priorProfile != null) {
if (!booleanPrefs.isEmpty() || !intPrefs.isEmpty() || !stringPrefs.isEmpty()) {
throw new IllegalStateException(
"Unable to determine if preferences set on this option " +
"are the same as the profile in the capabilities");
}
if (!priorProfile.equals(profile)) {
throw new IllegalStateException(
"Profile has been set on both the capabilities and these options, but they're " +
Expand Down

0 comments on commit a4e5719

Please sign in to comment.