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

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

Issue 3367001: Work around download system breakpage by using WaitUntil on pyauto side. (Closed)
Patch Set: Created 10 years, 4 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/downloads.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 36778515cf96dbaacf410f407f8ee2006053c5d4..2a48f55831f32e16db7d69f4e60803fa3bf70daf 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.
« no previous file with comments | « chrome/test/functional/downloads.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698