OLD | NEW |
1 Index: patch.diff | 1 diff --git a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java b/jav
a/client/src/org/openqa/selenium/chrome/ChromeOptions.java |
2 =================================================================== | 2 index 423cfe9..67e0ddb 100644 |
3 --- patch.diff (revision 199265) | 3 --- a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java |
4 +++ patch.diff (working copy) | 4 +++ b/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java |
5 @@ -1,16 +1,16 @@ | 5 @@ -71,6 +71,7 @@ |
6 diff --git a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java b/ja
va/client/src/org/openqa/selenium/chrome/ChromeOptions.java | 6 public static final String CAPABILITY = "chromeOptions"; |
7 -index 322ca9f..79a7109 100644 | 7 |
8 +index 423cfe9..67e0ddb 100644 | 8 private String binary; |
9 --- a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java | 9 + private String androidPackage; |
10 +++ b/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java | 10 private List<String> args = Lists.newArrayList(); |
11 @@ -71,6 +71,7 @@ | 11 private List<File> extensionFiles = Lists.newArrayList(); |
12 public static final String CAPABILITY = "chromeOptions"; | 12 private Map<String, Object> experimentalOptions = Maps.newHashMap(); |
13 | 13 @@ -98,6 +99,16 @@ public void setBinary(String path) { |
14 - private File binary; | 14 } |
15 + private String binary; | 15 |
16 + private String androidPackage; | 16 /** |
17 private List<String> args = Lists.newArrayList(); | 17 + * Sets the Android package name for Chrome. The package should already exist |
18 private List<File> extensionFiles = Lists.newArrayList(); | 18 + * on the Android device. |
19 private Map<String, Object> experimentalOptions = Maps.newHashMap(); | 19 + * |
20 -@@ -87,6 +88,16 @@ public void setBinary(File path) { | 20 + * @param package_name Name of Chrome's Android package. |
21 +@@ -98,6 +99,16 @@ public void setBinary(String path) { | 21 + */ |
22 } | 22 + public void setAndroidPackage(String package_name) { |
23 | 23 + androidPackage = checkNotNull(package_name); |
24 /** | 24 + } |
25 @@ -27,8 +27,8 @@ | 25 + |
26 * @param arguments The arguments to use when starting Chrome. | 26 + /** |
27 * @see #addArguments(java.util.List) | 27 * @param arguments The arguments to use when starting Chrome. |
28 */ | 28 * @see #addArguments(java.util.List) |
29 -@@ -165,6 +176,10 @@ public JSONObject toJson() throws IOException, JSONExcepti
on { | 29 */ |
30 - options.put("binary", binary.getPath()); | 30 @@ -176,6 +187,10 @@ public JSONObject toJson() throws IOException, JSONExceptio
n { |
31 +@@ -176,6 +187,10 @@ public JSONObject toJson() throws IOException, JSONExcepti
on { | 31 options.put("binary", binary); |
32 + options.put("binary", binary); | 32 } |
33 } | 33 |
34 | 34 + if (androidPackage != null) { |
35 + if (androidPackage != null) { | 35 + options.put("androidPackage", androidPackage); |
36 @@ -39,7 +39,7 @@ | 36 + } |
37 | 37 + |
38 List<String> extensions = Lists.newArrayListWithExpectedSize( | 38 options.put("args", ImmutableList.copyOf(args)); |
39 diff --git a/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.jav
a b/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java | 39 |
40 -index 7b2d178..4e2c3d6 100644 | 40 List<String> extensions = Lists.newArrayListWithExpectedSize( |
41 +index a486201..036a060 100644 | 41 diff --git a/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java
b/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java |
42 --- a/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java | 42 index a486201..036a060 100644 |
43 +++ b/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java | 43 --- a/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java |
44 @@ -64,6 +64,7 @@ | 44 +++ b/java/client/src/org/openqa/selenium/remote/HttpCommandExecutor.java |
45 @@ -63,10 +63,10 @@ | 45 @@ -64,6 +64,7 @@ |
46 HttpResponse response = fallBackExecute(context, httpMethod); | 46 import static org.openqa.selenium.remote.DriverCommand.*; |
47 log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), false)
); | 47 |
48 diff --git a/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java b
/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java | 48 public class HttpCommandExecutor implements CommandExecutor, NeedsLocalLogs { |
49 -index ac6efbf..7fbad26 100644 | 49 + private static final int SO_TIMEOUT = Integer.parseInt(System.getProperty("ht
tp.socket.timeout", "60")) * 1000; |
50 +index e5beaf1..89d8971 100755 | 50 |
51 --- a/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java | 51 private static final int MAX_REDIRECTS = 10; |
52 +++ b/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java | 52 |
53 -@@ -27,6 +27,7 @@ | 53 @@ -291,6 +292,11 @@ public Response execute(Command command) throws IOException
{ |
54 +@@ -28,6 +28,7 @@ | 54 httpMethod.addHeader("Cache-Control", "no-cache"); |
55 import org.junit.runner.RunWith; | 55 } |
56 import org.openqa.selenium.Pages; | 56 |
57 import org.openqa.selenium.WebDriver; | 57 + // Set the timeout for waiting response from server side. |
58 @@ -74,7 +74,7 @@ | 58 + HttpParams params = new BasicHttpParams(); |
59 import org.openqa.selenium.environment.GlobalTestEnvironment; | 59 + params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, SO_TIMEOUT); |
60 import org.openqa.selenium.environment.InProcessTestEnvironment; | 60 + httpMethod.setParams(params); |
61 import org.openqa.selenium.environment.TestEnvironment; | 61 + |
62 -@@ -90,6 +91,16 @@ public WebDriver getWrappedDriver() { | 62 log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), true)); |
63 +@@ -94,6 +95,16 @@ public WebDriver getWrappedDriver() { | 63 HttpResponse response = fallBackExecute(context, httpMethod); |
64 public static WebDriver actuallyCreateDriver() { | 64 log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), false))
; |
65 WebDriver driver = storedDriver.get(); | 65 diff --git a/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java b/
java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java |
66 | 66 index e5beaf1..89d8971 100755 |
67 @@ -91,7 +91,7 @@ | 67 --- a/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java |
68 if (driver == null) { | 68 +++ b/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java |
69 driver = new WebDriverBuilder().get(); | 69 @@ -28,6 +28,7 @@ |
70 storedDriver.set(driver); | 70 import org.junit.runner.RunWith; |
71 -@@ -122,4 +133,4 @@ protected boolean isIeDriverTimedOutException(IllegalStateE
xception e) { | 71 import org.openqa.selenium.Pages; |
72 +@@ -126,4 +137,4 @@ protected boolean isIeDriverTimedOutException(IllegalStateE
xception e) { | 72 import org.openqa.selenium.WebDriver; |
73 return e.getClass().getName().contains("TimedOutException"); | 73 +import org.openqa.selenium.WebDriverException; |
74 } | 74 import org.openqa.selenium.environment.GlobalTestEnvironment; |
75 | 75 import org.openqa.selenium.environment.InProcessTestEnvironment; |
76 @@ -99,10 +99,10 @@ | 76 import org.openqa.selenium.environment.TestEnvironment; |
77 \ No newline at end of file | 77 @@ -94,6 +95,16 @@ public WebDriver getWrappedDriver() { |
78 +} | 78 public static WebDriver actuallyCreateDriver() { |
79 diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDri
ver.java b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver
.java | 79 WebDriver driver = storedDriver.get(); |
80 -index e8a1c22..1629284 100644 | 80 |
81 +index f8e3e02..58bd0cc 100755 | 81 + // If the driver is left in a bad state, create a new one. |
82 --- a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.jav
a | 82 + // This happens on Android after any test that creates its own driver. |
83 +++ b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.jav
a | 83 + // Since only one instance of Chrome can run on Android at a time, the |
84 -@@ -73,6 +73,10 @@ private static DesiredCapabilities chromeWithCustomCapabilit
ies( | 84 + // stored driver's browser is destroyed. |
85 +@@ -76,6 +76,10 @@ private static DesiredCapabilities chromeWithCustomCapabilit
ies( | 85 + try { |
86 if (chromePath != null) { | 86 + if (driver != null) |
87 options.setBinary(new File(chromePath)); | 87 + driver.getCurrentUrl(); |
88 } | 88 + } catch (WebDriverException e) { |
89 @@ -114,10 +114,10 @@ | 89 + driver = null; |
90 DesiredCapabilities capabilities = DesiredCapabilities.chrome(); | 90 + } |
91 capabilities.setCapability(ChromeOptions.CAPABILITY, options); | 91 if (driver == null) { |
92 diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance
.java b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java | 92 driver = new WebDriverBuilder().get(); |
93 -index 587cea0..c14b8fd 100644 | 93 storedDriver.set(driver); |
94 +index c04d79d..8fe0370 100644 | 94 @@ -126,4 +137,4 @@ protected boolean isIeDriverTimedOutException(IllegalStateEx
ception e) { |
95 --- a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java | 95 return e.getClass().getName().contains("TimedOutException"); |
96 +++ b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java | 96 } |
97 -@@ -93,8 +93,28 @@ public boolean isIgnored(AnnotatedElement element) { | 97 |
98 +@@ -92,8 +92,28 @@ public boolean isIgnored(AnnotatedElement element) { | 98 -} |
99 return ignored; | 99 \ No newline at end of file |
100 } | 100 +} |
101 | 101 diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriv
er.java b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.
java |
102 @@ -147,7 +147,7 @@ | 102 index f8e3e02..58bd0cc 100755 |
103 boolean ignored = ignoreComparator.shouldIgnore(test.getClass().getAnnotat
ion(Ignore.class)) || | 103 --- a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java |
104 ignoreComparator.shouldIgnore(method.getMethod().getAnno
tation(Ignore.class)); | 104 +++ b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java |
105 | 105 @@ -76,6 +76,10 @@ private static DesiredCapabilities chromeWithCustomCapabiliti
es( |
106 -@@ -224,4 +244,4 @@ private void addIgnoresForBrowser(Browser browser, IgnoreCo
mparator comparator) | 106 if (chromePath != null) { |
107 +@@ -220,4 +240,4 @@ private void addIgnoresForBrowser(Browser browser, IgnoreCo
mparator comparator) | 107 options.setBinary(new File(chromePath)); |
108 } | 108 } |
109 } | 109 + String androidPackage = System.getProperty("webdriver.chrome.android_packag
e"); |
110 | 110 + if (androidPackage != null) { |
111 @@ -155,7 +155,7 @@ | 111 + options.setAndroidPackage(androidPackage); |
112 \ No newline at end of file | 112 + } |
113 +} | 113 |
114 diff --git a/rake-tasks/crazy_fun/mappings/java.rb b/rake-tasks/crazy_fun/mappi
ngs/java.rb | 114 DesiredCapabilities capabilities = DesiredCapabilities.chrome(); |
115 -index c41395e..7122c6c 100644 | 115 capabilities.setCapability(ChromeOptions.CAPABILITY, options); |
116 +index f723db2..5876840 100644 | 116 diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.
java b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java |
117 --- a/rake-tasks/crazy_fun/mappings/java.rb | 117 index c04d79d..8fe0370 100644 |
118 +++ b/rake-tasks/crazy_fun/mappings/java.rb | 118 --- a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java |
119 @@ -34,6 +34,7 @@ class JavaMappings | 119 +++ b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java |
| 120 @@ -92,8 +92,28 @@ public boolean isIgnored(AnnotatedElement element) { |
| 121 return ignored; |
| 122 } |
| 123 |
| 124 - // JUnit 4 |
| 125 public boolean isIgnored(FrameworkMethod method, Object test) { |
| 126 + String name = test.getClass().getSimpleName() + "." + method.getName(); |
| 127 + String filter = System.getProperty("filter", ".*"); |
| 128 + String[] patternGroups = filter.split("-"); |
| 129 + String[] positivePatterns = patternGroups[0].split(":"); |
| 130 + String[] negativePatterns = new String[0]; |
| 131 + if (patternGroups.length > 1) |
| 132 + negativePatterns = patternGroups[1].split(":"); |
| 133 + |
| 134 + for (int i = 0; i < negativePatterns.length; i++) { |
| 135 + if (name.matches(negativePatterns[i])) |
| 136 + return true; |
| 137 + } |
| 138 + for (int i = 0; i < positivePatterns.length; i++) { |
| 139 + if (name.matches(positivePatterns[i])) |
| 140 + return false; |
| 141 + } |
| 142 + return true; |
| 143 + } |
| 144 + |
| 145 + // JUnit 4 |
| 146 + public boolean isIgnoredOld(FrameworkMethod method, Object test) { |
| 147 boolean ignored = ignoreComparator.shouldIgnore(test.getClass().getAnnotati
on(Ignore.class)) || |
| 148 ignoreComparator.shouldIgnore(method.getMethod().getAnnot
ation(Ignore.class)); |
| 149 |
| 150 @@ -220,4 +240,4 @@ private void addIgnoresForBrowser(Browser browser, IgnoreCom
parator comparator) |
| 151 } |
| 152 } |
| 153 |
| 154 -} |
| 155 \ No newline at end of file |
| 156 +} |
| 157 diff --git a/rake-tasks/crazy_fun/mappings/java.rb b/rake-tasks/crazy_fun/mappin
gs/java.rb |
| 158 index f723db2..5876840 100644 |
| 159 --- a/rake-tasks/crazy_fun/mappings/java.rb |
| 160 +++ b/rake-tasks/crazy_fun/mappings/java.rb |
| 161 @@ -34,6 +34,7 @@ class JavaMappings |
| 162 fun.add_mapping("java_test", CrazyFunJava::RunTests.new) |
| 163 fun.add_mapping("java_test", CrazyFunJava::CreateSourceJar.new) |
| 164 fun.add_mapping("java_test", CrazyFunJava::CreateUberJar.new) |
| 165 + fun.add_mapping("java_test", CrazyFunJava::CreateProjectSourceJar.new) |
| 166 fun.add_mapping("java_test", CrazyFunJava::CreateProjectJar.new) |
| 167 end |
| 168 end |
OLD | NEW |