OLD | NEW |
---|---|
1 Index: java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.jav a | 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 322ca9f..bb3918b 100644 |
3 --- java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java» (revision 17049) | 3 --- a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java |
4 +++ java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java» (working copy) | 4 +++ b/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java |
5 @@ -74,6 +74,10 @@ | 5 @@ -71,6 +71,7 @@ |
6 if (chromePath != null) { | |
7 options.setBinary(new File(chromePath)); | |
8 } | |
9 + String androidPackage = System.getProperty("webdriver.chrome.android_packag e"); | |
10 + if (androidPackage != null) { | |
11 + options.setAndroidPackage(androidPackage); | |
12 + } | |
13 | |
14 DesiredCapabilities capabilities = DesiredCapabilities.chrome(); | |
15 capabilities.setCapability(ChromeOptions.CAPABILITY, options); | |
16 Index: java/client/src/org/openqa/selenium/chrome/ChromeOptions.java | |
17 =================================================================== | |
18 --- java/client/src/org/openqa/selenium/chrome/ChromeOptions.java» (revisio n 17049) | |
19 +++ java/client/src/org/openqa/selenium/chrome/ChromeOptions.java» (working copy) | |
20 @@ -65,6 +65,7 @@ | |
21 public static final String CAPABILITY = "chromeOptions"; | 6 public static final String CAPABILITY = "chromeOptions"; |
22 | 7 |
23 private File binary; | 8 private File binary; |
24 + private String androidPackage; | 9 + private String androidPackage; |
25 private List<String> args = Lists.newArrayList(); | 10 private List<String> args = Lists.newArrayList(); |
26 private List<File> extensionFiles = Lists.newArrayList(); | 11 private List<File> extensionFiles = Lists.newArrayList(); |
27 private Map<String, Object> experimentalOptions = Maps.newHashMap(); | 12 private Map<String, Object> experimentalOptions = Maps.newHashMap(); |
28 @@ -81,6 +82,16 @@ | 13 @@ -87,6 +88,16 @@ public void setBinary(File path) { |
29 } | 14 } |
30 | 15 |
31 /** | 16 /** |
32 + * Sets the Android package name for Chrome. The package should already exist | 17 + * Sets the Android package name for Chrome. The package should already exist |
33 + * on the Android device. | 18 + * on the Android device. |
34 + * | 19 + * |
35 + * @param package_name Name of Chrome's Android package. | 20 + * @param package_name Name of Chrome's Android package. |
36 + */ | 21 + */ |
37 + public void setAndroidPackage(String package_name) { | 22 + public void setAndroidPackage(String package_name) { |
38 + androidPackage = checkNotNull(package_name); | 23 + androidPackage = checkNotNull(package_name); |
39 + } | 24 + } |
40 + | 25 + |
41 + /** | 26 + /** |
42 * @param arguments The arguments to use when starting Chrome. | 27 * @param arguments The arguments to use when starting Chrome. |
43 * @see #addArguments(java.util.List) | 28 * @see #addArguments(java.util.List) |
44 */ | 29 */ |
45 @@ -147,6 +158,10 @@ | 30 @@ -165,6 +176,10 @@ public JSONObject toJson() throws IOException, JSONExceptio n { |
46 options.put("binary", binary.getPath()); | 31 options.put("binary", binary.getPath()); |
47 } | 32 } |
48 | 33 |
49 + if (androidPackage != null) { | 34 + if (androidPackage != null) { |
50 + options.put("android_package", androidPackage); | 35 + options.put("android_package", androidPackage); |
51 + } | 36 + } |
52 + | 37 + |
53 options.put("args", ImmutableList.copyOf(args)); | 38 options.put("args", ImmutableList.copyOf(args)); |
54 | 39 |
55 List<String> extensions = Lists.newArrayListWithExpectedSize( | 40 List<String> extensions = Lists.newArrayListWithExpectedSize( |
41 diff --git a/java/client/test/keystore b/java/client/test/keystore | |
42 deleted file mode 100644 | |
43 index 92040cd..0000000 | |
44 Binary files a/java/client/test/keystore and /dev/null differ | |
45 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 | |
46 index e8a1c22..1629284 100644 | |
47 --- a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java | |
48 +++ b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java | |
49 @@ -73,6 +73,10 @@ private static DesiredCapabilities chromeWithCustomCapabiliti es( | |
50 if (chromePath != null) { | |
51 options.setBinary(new File(chromePath)); | |
52 } | |
53 + String androidPackage = System.getProperty("webdriver.chrome.android_packag e"); | |
54 + if (androidPackage != null) { | |
55 + options.setAndroidPackage(androidPackage); | |
56 + } | |
57 | |
58 DesiredCapabilities capabilities = DesiredCapabilities.chrome(); | |
59 capabilities.setCapability(ChromeOptions.CAPABILITY, options); | |
60 diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance. java b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java | |
61 index 587cea0..91545ed 100644 | |
62 --- a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java | |
63 +++ b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java | |
64 @@ -93,8 +93,35 @@ public boolean isIgnored(AnnotatedElement element) { | |
65 return ignored; | |
66 } | |
67 | |
68 - // JUnit 4 | |
69 public boolean isIgnored(FrameworkMethod method, Object test) { | |
70 + String name = test.getClass().getSimpleName() + "." + method.getName(); | |
71 + String filter = System.getProperty("filter", ".*"); | |
chrisgao (Use stgao instead)
2013/04/05 15:41:09
I think it is OK to create the positive/negative p
kkania
2013/04/05 17:31:26
keeping it here; it doesn't really matter, as you
| |
72 + String[] patternGroups = filter.split("-"); | |
73 + String[] positivePatterns = patternGroups[0].split(":"); | |
74 + String[] negativePatterns = new String[0]; | |
75 + if (patternGroups.length > 1) | |
76 + negativePatterns = patternGroups[1].split(":"); | |
77 + | |
78 + boolean positive = false; | |
79 + for (int i = 0; i < positivePatterns.length; i++) { | |
chrisgao (Use stgao instead)
2013/04/05 15:41:09
Test against negative patterns and then the positi
kkania
2013/04/05 17:31:26
Done.
| |
80 + if (name.matches(positivePatterns[i])) { | |
81 + positive = true; | |
82 + break; | |
83 + } | |
84 + } | |
85 + if (!positive) | |
86 + return true; | |
87 + | |
88 + for (int i = 0; i < negativePatterns.length; i++) { | |
89 + if (name.matches(negativePatterns[i])) { | |
90 + return true; | |
91 + } | |
92 + } | |
93 + return false; | |
94 + } | |
95 + | |
96 + // JUnit 4 | |
97 + public boolean isIgnoredOld(FrameworkMethod method, Object test) { | |
98 boolean ignored = ignoreComparator.shouldIgnore(test.getClass().getAnnotati on(Ignore.class)) || | |
99 ignoreComparator.shouldIgnore(method.getMethod().getAnnot ation(Ignore.class)); | |
100 | |
101 @@ -224,4 +251,4 @@ private void addIgnoresForBrowser(Browser browser, IgnoreCom parator comparator) | |
102 } | |
103 } | |
104 | |
105 -} | |
106 \ No newline at end of file | |
107 +} | |
OLD | NEW |