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

Side by Side Diff: patch.diff

Issue 27192006: [chromedriver] Log exceptions thrown when quitting the session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webdriver/
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test-nodeps-srcs.jar » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 diff --git a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java b/jav a/client/src/org/openqa/selenium/chrome/ChromeOptions.java 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 index 423cfe9..67e0ddb 100644 2 index 423cfe9..67e0ddb 100644
3 --- a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java 3 --- a/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java
4 +++ b/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java 4 +++ b/java/client/src/org/openqa/selenium/chrome/ChromeOptions.java
5 @@ -71,6 +71,7 @@ 5 @@ -71,6 +71,7 @@
6 public static final String CAPABILITY = "chromeOptions"; 6 public static final String CAPABILITY = "chromeOptions";
7 7
8 private String binary; 8 private String binary;
9 + private String androidPackage; 9 + private String androidPackage;
10 private List<String> args = Lists.newArrayList(); 10 private List<String> args = Lists.newArrayList();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 + // Set the timeout for waiting response from server side. 57 + // Set the timeout for waiting response from server side.
58 + HttpParams params = new BasicHttpParams(); 58 + HttpParams params = new BasicHttpParams();
59 + params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, SO_TIMEOUT); 59 + params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, SO_TIMEOUT);
60 + httpMethod.setParams(params); 60 + httpMethod.setParams(params);
61 + 61 +
62 log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), true)); 62 log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), true));
63 HttpResponse response = fallBackExecute(context, httpMethod); 63 HttpResponse response = fallBackExecute(context, httpMethod);
64 log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), false)) ; 64 log(LogType.PROFILER, new HttpProfilerLogEntry(command.getName(), false)) ;
65 diff --git a/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java b/ java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java 65 diff --git a/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java b/ java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java
66 index e5beaf1..41e2791 100755 66 index e5beaf1..5eb4477 100755
67 --- a/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java 67 --- a/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java
68 +++ b/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java 68 +++ b/java/client/test/org/openqa/selenium/testing/JUnit4TestBase.java
69 @@ -28,6 +28,7 @@ 69 @@ -28,6 +28,7 @@
70 import org.junit.runner.RunWith; 70 import org.junit.runner.RunWith;
71 import org.openqa.selenium.Pages; 71 import org.openqa.selenium.Pages;
72 import org.openqa.selenium.WebDriver; 72 import org.openqa.selenium.WebDriver;
73 +import org.openqa.selenium.WebDriverException; 73 +import org.openqa.selenium.WebDriverException;
74 import org.openqa.selenium.environment.GlobalTestEnvironment; 74 import org.openqa.selenium.environment.GlobalTestEnvironment;
75 import org.openqa.selenium.environment.InProcessTestEnvironment; 75 import org.openqa.selenium.environment.InProcessTestEnvironment;
76 import org.openqa.selenium.environment.TestEnvironment; 76 import org.openqa.selenium.environment.TestEnvironment;
77 @@ -94,6 +95,21 @@ public WebDriver getWrappedDriver() { 77 @@ -94,6 +95,22 @@ public WebDriver getWrappedDriver() {
78 public static WebDriver actuallyCreateDriver() { 78 public static WebDriver actuallyCreateDriver() {
79 WebDriver driver = storedDriver.get(); 79 WebDriver driver = storedDriver.get();
80 80
81 + // If the driver is left in a bad state, create a new one. 81 + // If the driver is left in a bad state, create a new one.
82 + // This happens on Android after any test that creates its own driver. 82 + // This happens on Android after any test that creates its own driver.
83 + // Since only one instance of Chrome can run on Android at a time, the 83 + // Since only one instance of Chrome can run on Android at a time, the
84 + // stored driver's browser is destroyed. 84 + // stored driver's browser is destroyed.
85 + try { 85 + try {
86 + if (driver != null) 86 + if (driver != null)
87 + driver.getCurrentUrl(); 87 + driver.getCurrentUrl();
88 + } catch (WebDriverException e) { 88 + } catch (WebDriverException e) {
89 + try { 89 + try {
90 + driver.quit(); 90 + driver.quit();
91 + } catch (RuntimeException ignored) { 91 + } catch (RuntimeException ignored) {
92 + // fall through 92 + // fall through
93 + logger.warning(ignored.getMessage());
93 + } 94 + }
94 + driver = null; 95 + driver = null;
95 + } 96 + }
96 if (driver == null) { 97 if (driver == null) {
97 driver = new WebDriverBuilder().get(); 98 driver = new WebDriverBuilder().get();
98 storedDriver.set(driver); 99 storedDriver.set(driver);
99 @@ -126,4 +142,4 @@ protected boolean isIeDriverTimedOutException(IllegalStateEx ception e) { 100 @@ -116,6 +133,7 @@ public static void removeDriver() {
101 current.quit();
102 } catch (RuntimeException ignored) {
103 // fall through
104 + logger.warning(ignored.getMessage());
105 }
106
107 storedDriver.remove();
108 @@ -126,4 +144,4 @@ protected boolean isIeDriverTimedOutException(IllegalStateEx ception e) {
100 return e.getClass().getName().contains("TimedOutException"); 109 return e.getClass().getName().contains("TimedOutException");
101 } 110 }
102 111
103 -} 112 -}
104 \ No newline at end of file 113 \ No newline at end of file
105 +} 114 +}
106 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 115 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
107 index f8e3e02..58bd0cc 100755 116 index f8e3e02..58bd0cc 100755
108 --- a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java 117 --- a/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java
109 +++ b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java 118 +++ b/java/client/test/org/openqa/selenium/testing/drivers/TestChromeDriver.java
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 --- a/rake-tasks/crazy_fun/mappings/java.rb 173 --- a/rake-tasks/crazy_fun/mappings/java.rb
165 +++ b/rake-tasks/crazy_fun/mappings/java.rb 174 +++ b/rake-tasks/crazy_fun/mappings/java.rb
166 @@ -34,6 +34,7 @@ class JavaMappings 175 @@ -34,6 +34,7 @@ class JavaMappings
167 fun.add_mapping("java_test", CrazyFunJava::RunTests.new) 176 fun.add_mapping("java_test", CrazyFunJava::RunTests.new)
168 fun.add_mapping("java_test", CrazyFunJava::CreateSourceJar.new) 177 fun.add_mapping("java_test", CrazyFunJava::CreateSourceJar.new)
169 fun.add_mapping("java_test", CrazyFunJava::CreateUberJar.new) 178 fun.add_mapping("java_test", CrazyFunJava::CreateUberJar.new)
170 + fun.add_mapping("java_test", CrazyFunJava::CreateProjectSourceJar.new) 179 + fun.add_mapping("java_test", CrazyFunJava::CreateProjectSourceJar.new)
171 fun.add_mapping("java_test", CrazyFunJava::CreateProjectJar.new) 180 fun.add_mapping("java_test", CrazyFunJava::CreateProjectJar.new)
172 end 181 end
173 end 182 end
OLDNEW
« no previous file with comments | « no previous file | test-nodeps-srcs.jar » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698