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

Unified Diff: chrome/test/pyautolib/pyauto.py

Issue 10168019: Adds an automation hook WaitUntilNavigationCompletes() which blocks until pending navigation comple… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed a possible race condition. Created 8 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 | « chrome/test/functional/apptest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/pyautolib/pyauto.py
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index c3be1b4634f3fd100968a90dd308ea6dd0503d86..17d43b657b7e081362fc974e9948c2f86236385a 100755
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -3112,6 +3112,26 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
}
return self._GetResultFromJSONRequest(cmd_dict, windex=None)
+ def WaitUntilNavigationCompletes(self, tab_index=0, windex=0):
+ """Wait until the specified tab is done navigating.
+
+ It is safe to call ExecuteJavascript() as soon as the call returns. If
+ there is no outstanding navigation the call will return immediately.
+
+ Args:
+ tab_index: index of the tab.
+ windex: index of the window.
+
+ Raises:
+ pyauto_errors.JSONInterfaceError if the automation call returns an error.
+ """
+ cmd_dict = {
+ 'command': 'WaitUntilNavigationCompletes',
+ 'tab_index': tab_index,
+ 'windex': windex,
+ }
+ return self._GetResultFromJSONRequest(cmd_dict)
+
def ExecuteJavascript(self, js, tab_index=0, windex=0, frame_xpath=''):
"""Executes a script in the specified frame of a tab.
« no previous file with comments | « chrome/test/functional/apptest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698