Skip to content

Commit 394b638

Browse files
committed
Default to using marionette in all test cases
1 parent 477c581 commit 394b638

File tree

1 file changed

+2
-42
lines changed

1 file changed

+2
-42
lines changed

java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,15 @@
1717

1818
package org.openqa.selenium.testing.drivers;
1919

20-
import static org.openqa.selenium.Platform.WINDOWS;
2120
import static org.openqa.selenium.testing.DevMode.isInDevMode;
2221

2322
import com.google.common.base.Supplier;
2423
import com.google.common.base.Throwables;
25-
import com.google.common.io.Files;
2624

2725
import org.openqa.selenium.Capabilities;
28-
import org.openqa.selenium.Platform;
2926
import org.openqa.selenium.WebDriver;
30-
import org.openqa.selenium.firefox.FirefoxDriver;
31-
import org.openqa.selenium.firefox.FirefoxProfile;
3227
import org.openqa.selenium.remote.DesiredCapabilities;
33-
import org.openqa.selenium.testing.InProject;
3428

35-
import java.io.File;
36-
import java.io.IOException;
3729
import java.lang.reflect.InvocationTargetException;
3830
import java.util.logging.Logger;
3931

@@ -59,30 +51,6 @@ public WebDriver get() {
5951
return null;
6052
}
6153

62-
if (DesiredCapabilities.firefox().getBrowserName().equals(desiredCapsToUse.getBrowserName())) {
63-
boolean isMarionette = Boolean.getBoolean(FirefoxDriver.SystemProperty.DRIVER_USE_MARIONETTE);
64-
if (!isMarionette) {
65-
desiredCapsToUse.setCapability(FirefoxDriver.MARIONETTE, false);
66-
if (isInDevMode()) {
67-
copyFirefoxDriverDefaultsToOutputDir();
68-
}
69-
70-
FirefoxProfile profile = new FirefoxProfile();
71-
boolean enableNativeEvents = Boolean.getBoolean("selenium.browser.native_events") ||
72-
Platform.getCurrent().is(WINDOWS);
73-
profile.setEnableNativeEvents(enableNativeEvents);
74-
desiredCapsToUse.setCapability(FirefoxDriver.PROFILE, profile);
75-
}
76-
77-
try {
78-
return driverClass.getConstructor(Capabilities.class,
79-
Capabilities.class)
80-
.newInstance(desiredCapsToUse, requiredCapabilities);
81-
} catch (NoSuchMethodException ex) {
82-
return driverClass.getConstructor(Capabilities.class).newInstance(desiredCapsToUse);
83-
}
84-
}
85-
8654
try {
8755
return driverClass.getConstructor(Capabilities.class,
8856
Capabilities.class).newInstance(desiredCapsToUse, requiredCapabilities);
@@ -98,25 +66,17 @@ public WebDriver get() {
9866
}
9967
}
10068

101-
private void copyFirefoxDriverDefaultsToOutputDir() throws IOException {
102-
File defaults = InProject.locate("javascript/firefox-driver/webdriver.json");
103-
File out = InProject.locate("java/client/build/production/org/openqa/selenium/firefox/FirefoxProfile.class").getParentFile();
104-
out = new File(out, "webdriver.json");
105-
Files.copy(defaults, out);
106-
}
107-
10869
// Cover your eyes
10970
private Class<? extends WebDriver> mapToClass(Capabilities caps) {
11071
String name = caps == null ? "" : caps.getBrowserName();
111-
String className = null;
72+
String className;
11273

11374
if (DesiredCapabilities.chrome().getBrowserName().equals(name)) {
11475
className = "org.openqa.selenium.testing.drivers.TestChromeDriver";
11576
} else if (DesiredCapabilities.operaBlink().getBrowserName().equals(name)) {
11677
className = "org.openqa.selenium.testing.drivers.TestOperaBlinkDriver";
11778
} else if (DesiredCapabilities.firefox().getBrowserName().equals(name)) {
118-
Object marionette = caps.getCapability(FirefoxDriver.MARIONETTE);
119-
if (isInDevMode() && marionette != null && !(Boolean) marionette) {
79+
if (isInDevMode()) {
12080
className = "org.openqa.selenium.testing.drivers.SynthesizedFirefoxDriver";
12181
} else {
12282
className = "org.openqa.selenium.firefox.FirefoxDriver";

0 commit comments

Comments
 (0)