Skip to content

Commit

Permalink
server: Making a copy of capabilities object to prevent its modificat…
Browse files Browse the repository at this point in the history
…ion if a user registers a custom driver provider with his own capabilities
  • Loading branch information
barancev committed Jun 11, 2015
1 parent 26bf0bc commit d0958a6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
Expand All @@ -38,12 +39,12 @@ public class DefaultDriverProvider implements DriverProvider {
private String driverClassName;

public DefaultDriverProvider(Capabilities capabilities, Class<? extends WebDriver> driverClass) {
this.capabilities = capabilities;
this.capabilities = new DesiredCapabilities(capabilities);
this.driverClass = driverClass;
}

public DefaultDriverProvider(Capabilities capabilities, String driverClassName) {
this.capabilities = capabilities;
this.capabilities = new DesiredCapabilities(capabilities);
this.driverClassName = driverClassName;
}

Expand Down

0 comments on commit d0958a6

Please sign in to comment.