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

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

Issue 7544026: Fix for flakiness in pyauto automation hook WaitForDownloadsToComplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-wrote the first patch set. Created 9 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
Index: chrome/test/pyautolib/download_info.py
diff --git a/chrome/test/pyautolib/download_info.py b/chrome/test/pyautolib/download_info.py
index e01fdac69002cfe1cb227f718875d63c8a796420..5f621a2be6721b7217bf8c8291d9c5ce1a002c2c 100644
--- a/chrome/test/pyautolib/download_info.py
+++ b/chrome/test/pyautolib/download_info.py
@@ -10,8 +10,9 @@ Obtain one of these from PyUITestSuite::GetDownloadsInfo() call.
class MyDownloadsTest(pyauto.PyUITest):
def testDownload(self):
- self.NavigateToURL('http://my.url/package.zip')
- self.WaitForDownloadsToComplete()
+ pre_download_ids = [x['id'] for x in self.GetDownloadsInfo().Downloads()]
+ self.DownloadAndWaitForStart('http://my.url/package.zip')
+ self.WaitForAllDownloadsToComplete(pre_download_ids)
info = self.GetDownloadsInfo()
print info.Downloads()
self.assertEqual(info.Downloads()[0]['file_name'], 'packge.zip')

Powered by Google App Engine
This is Rietveld 408576698