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

Unified Diff: chrome/test/chromedriver/chromedriver.py

Issue 12675002: [chromedriver] Implement command: executeAsyncScript and setScriptTimeout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address +5000 timeout problem. Created 7 years, 9 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 | « chrome/chrome_tests.gypi ('k') | chrome/test/chromedriver/command_executor_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chromedriver.py
diff --git a/chrome/test/chromedriver/chromedriver.py b/chrome/test/chromedriver/chromedriver.py
index b290ac0814ba96c93bc548aa193ba3142a383853..dad8f7d8cd8758b28d13b7793059a0d86d232543 100644
--- a/chrome/test/chromedriver/chromedriver.py
+++ b/chrome/test/chromedriver/chromedriver.py
@@ -17,12 +17,16 @@ class StaleElementReference(ChromeDriverException):
pass
class UnknownError(ChromeDriverException):
pass
+class JavaScriptError(ChromeDriverException):
+ pass
class XPathLookupError(ChromeDriverException):
pass
class NoSuchWindow(ChromeDriverException):
pass
class InvalidCookieDomain(ChromeDriverException):
pass
+class ScriptTimeout(ChromeDriverException):
+ pass
class InvalidSelector(ChromeDriverException):
pass
class SessionNotCreatedException(ChromeDriverException):
@@ -36,9 +40,11 @@ def _ExceptionForResponse(response):
9: UnknownCommand,
10: StaleElementReference,
13: UnknownError,
+ 17: JavaScriptError,
19: XPathLookupError,
23: NoSuchWindow,
24: InvalidCookieDomain,
+ 28: ScriptTimeout,
32: InvalidSelector,
33: SessionNotCreatedException,
100: NoSuchSession
@@ -155,6 +161,11 @@ class ChromeDriver(object):
return self.ExecuteSessionCommand(
'executeScript', {'script': script, 'args': converted_args})
+ def ExecuteAsyncScript(self, script, *args):
+ converted_args = list(args)
+ return self.ExecuteSessionCommand(
+ 'executeAsyncScript', {'script': script, 'args': converted_args})
+
def SwitchToFrame(self, id_or_name):
self.ExecuteSessionCommand('switchToFrame', {'id': id_or_name})
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/test/chromedriver/command_executor_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698