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

Unified Diff: chrome/test/chromedriver/run_py_tests.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
Index: chrome/test/chromedriver/run_py_tests.py
diff --git a/chrome/test/chromedriver/run_py_tests.py b/chrome/test/chromedriver/run_py_tests.py
index 64732b3b67ce67f45c3425039782206806d2c070..6f7ccb700ec5a51dd80a99c2d5c59029b73b84c7 100755
--- a/chrome/test/chromedriver/run_py_tests.py
+++ b/chrome/test/chromedriver/run_py_tests.py
@@ -147,6 +147,19 @@ class ChromeDriverTest(ChromeDriverBaseTest):
self.assertRaises(chromedriver.ChromeDriverException,
self._driver.ExecuteScript, '{{{')
+ def testExecuteAsyncScript(self):
+ self._driver.SetTimeout('script', 3000)
+ self.assertRaises(
+ chromedriver.ScriptTimeout,
+ self._driver.ExecuteAsyncScript,
+ 'var callback = arguments[0];'
+ 'setTimeout(function(){callback(1);}, 10000);')
+ self.assertEquals(
+ 2,
+ self._driver.ExecuteAsyncScript(
+ 'var callback = arguments[0];'
+ 'setTimeout(function(){callback(2);}, 300);'))
+
def testSwitchToFrame(self):
self._driver.ExecuteScript(
'var frame = document.createElement("iframe");'
« no previous file with comments | « chrome/test/chromedriver/js/execute_async_script_test.html ('k') | chrome/test/chromedriver/session_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698