summaryrefslogtreecommitdiffstats
path: root/chrome/test/pyautolib
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 01:49:35 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-02 01:49:35 +0000
commit1797608235e4f7b7a37a2bd6f37744dff26bd89f (patch)
tree6ddfb6aae672dba7c8d40546c524c687d270bb93 /chrome/test/pyautolib
parent95e030fc385e50fd5e13743cad96c42f280f9b43 (diff)
downloadchromium_src-1797608235e4f7b7a37a2bd6f37744dff26bd89f.zip
chromium_src-1797608235e4f7b7a37a2bd6f37744dff26bd89f.tar.gz
chromium_src-1797608235e4f7b7a37a2bd6f37744dff26bd89f.tar.bz2
Work around download system breakpage by using WaitUntil on pyauto side.
Review URL: http://codereview.chromium.org/3367001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58297 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/pyautolib')
-rw-r--r--chrome/test/pyautolib/pyauto.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index 3677851..2a48f55 100644
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -489,13 +489,22 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
}
self._GetResultFromJSONRequest(cmd_dict)
- def WaitForAllDownloadsToComplete(self):
+ def WaitForAllDownloadsToComplete(self, timeout=-1):
"""Wait for all downloads to complete.
+ Args:
+ timeout: The timeout to use - default is WaitUntil's default timeout.
+
Note: This method does not work for dangerous downloads. Use
WaitForGivenDownloadsToComplete (below) instead.
"""
- self._GetResultFromJSONRequest({'command': 'WaitForAllDownloadsToComplete'})
+ # Downloads implementation is largely broken. Try to get around by using
+ # WaitUntil instead of using notifications. crbug.com/54131
+ # self._GetResultFromJSONRequest(
+ # {'command': 'WaitForAllDownloadsToComplete'})
+ return self.WaitUntil(
+ lambda: len(self.GetDownloadsInfo().DownloadsInProgress()) == 0,
+ timeout=timeout)
def WaitForDownloadToComplete(self, download_path, timeout=-1):
"""Wait for the given downloads to complete.