Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: patch.diff

Issue 13688002: [chromedriver] Update Java tests to latest selenium release, 2.31. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webdriver/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common.zip ('k') | test-standalone.jar » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: patch.diff
===================================================================
--- patch.diff (revision 192389)
+++ patch.diff (working copy)
@@ -1,23 +1,8 @@
-Index: java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java
-===================================================================
---- java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java (revision 17049)
-+++ java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java (working copy)
-@@ -74,6 +74,10 @@
- if (chromePath != null) {
- options.setBinary(new File(chromePath));
- }
-+ String androidPackage = System.getProperty("webdriver.chrome.android_package");
-+ if (androidPackage != null) {
-+ options.setAndroidPackage(androidPackage);
-+ }
-
- DesiredCapabilities capabilities = DesiredCapabilities.chrome();
- capabilities.setCapability(ChromeOptions.CAPABILITY, options);
-Index: java/client/src/org/openqa/selenium/chrome/ChromeOptions.java
-===================================================================
---- java/client/src/org/openqa/selenium/chrome/ChromeOptions.java (revision 17049)
-+++ java/client/src/org/openqa/selenium/chrome/ChromeOptions.java (working copy)
-@@ -65,6 +65,7 @@
+diff --git a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java b/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java
+index 322ca9f..bb3918b 100644
+--- a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java
++++ b/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java
+@@ -71,6 +71,7 @@
public static final String CAPABILITY = "chromeOptions";
private File binary;
@@ -25,7 +10,7 @@
private List<String> args = Lists.newArrayList();
private List<File> extensionFiles = Lists.newArrayList();
private Map<String, Object> experimentalOptions = Maps.newHashMap();
-@@ -81,6 +82,16 @@
+@@ -87,6 +88,16 @@ public void setBinary(File path) {
}
/**
@@ -42,7 +27,7 @@
* @param arguments The arguments to use when starting Chrome.
* @see #addArguments(java.util.List)
*/
-@@ -147,6 +158,10 @@
+@@ -165,6 +176,10 @@ public JSONObject toJson() throws IOException, JSONException {
options.put("binary", binary.getPath());
}
@@ -53,3 +38,81 @@
options.put("args", ImmutableList.copyOf(args));
List<String> extensions = Lists.newArrayListWithExpectedSize(
+diff --git a/java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java b/java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java
+index 3cc5799..7316a41 100644
+--- a/java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java
++++ b/java/client/test/org/openqa/selenium/testing/drivers/ReflectionBackedDriverSupplier.java
+@@ -29,6 +29,7 @@
+ import org.openqa.selenium.WebDriver;
+ import org.openqa.selenium.firefox.FirefoxDriver;
+ import org.openqa.selenium.firefox.FirefoxProfile;
++import org.openqa.selenium.remote.Augmenter;
+ import org.openqa.selenium.remote.DesiredCapabilities;
+ import org.openqa.selenium.testing.InProject;
+
+@@ -76,7 +77,8 @@ public WebDriver get() {
+ }
+
+ //TODO: Call constructor with two Capabilities arguments for all driver classes
+- return driverClass.getConstructor(Capabilities.class).newInstance(desiredCapsToUse);
++ WebDriver d = driverClass.getConstructor(Capabilities.class).newInstance(desiredCapsToUse);
++ return new Augmenter().augment(d);
+ } catch (InvocationTargetException e) {
+ throw Throwables.propagate(e.getTargetException());
+ } catch (Exception e) {
+diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java
+index e8a1c22..1629284 100644
+--- a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java
++++ b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java
+@@ -73,6 +73,10 @@ private static DesiredCapabilities chromeWithCustomCapabilities(
+ if (chromePath != null) {
+ options.setBinary(new File(chromePath));
+ }
++ String androidPackage = System.getProperty("webdriver.chrome.android_package");
++ if (androidPackage != null) {
++ options.setAndroidPackage(androidPackage);
++ }
+
+ DesiredCapabilities capabilities = DesiredCapabilities.chrome();
+ capabilities.setCapability(ChromeOptions.CAPABILITY, options);
+diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java
+index 587cea0..c14b8fd 100644
+--- a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java
++++ b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java
+@@ -93,8 +93,28 @@ public boolean isIgnored(AnnotatedElement element) {
+ return ignored;
+ }
+
+- // JUnit 4
+ public boolean isIgnored(FrameworkMethod method, Object test) {
++ String name = test.getClass().getSimpleName() + "." + method.getName();
++ String filter = System.getProperty("filter", ".*");
++ String[] patternGroups = filter.split("-");
++ String[] positivePatterns = patternGroups[0].split(":");
++ String[] negativePatterns = new String[0];
++ if (patternGroups.length > 1)
++ negativePatterns = patternGroups[1].split(":");
++
++ for (int i = 0; i < negativePatterns.length; i++) {
++ if (name.matches(negativePatterns[i]))
++ return true;
++ }
++ for (int i = 0; i < positivePatterns.length; i++) {
++ if (name.matches(positivePatterns[i]))
++ return false;
++ }
++ return true;
++ }
++
++ // JUnit 4
++ public boolean isIgnoredOld(FrameworkMethod method, Object test) {
+ boolean ignored = ignoreComparator.shouldIgnore(test.getClass().getAnnotation(Ignore.class)) ||
+ ignoreComparator.shouldIgnore(method.getMethod().getAnnotation(Ignore.class));
+
+@@ -224,4 +244,4 @@ private void addIgnoresForBrowser(Browser browser, IgnoreComparator comparator)
+ }
+ }
+
+-}
+\ No newline at end of file
++}
« no previous file with comments | « common.zip ('k') | test-standalone.jar » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698