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

Unified Diff: chrome/test/functional/downloads.py

Issue 7544026: Fix for flakiness in pyauto automation hook WaitForDownloadsToComplete. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk; awaiting green trybots. 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
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/test/functional/test_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/downloads.py
diff --git a/chrome/test/functional/downloads.py b/chrome/test/functional/downloads.py
index 88c0be7f3003bb1653ef7758b2b7d84e6dd0e09f..f0c17585a62163e12df6d4133fcfa953eb5710a7 100644
--- a/chrome/test/functional/downloads.py
+++ b/chrome/test/functional/downloads.py
@@ -136,11 +136,8 @@ class DownloadsTest(pyauto.PyUITest):
self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
# Trigger download and wait in new incognito window.
- self.DownloadAndWaitForStart(file_url, 1)
- self.WaitForAllDownloadsToComplete(1)
- # Remove next line when WaitForAllDownloadsToComplete can reliably wait
- # for downloads in incognito window. crbug.com/69738
- self.WaitForDownloadToComplete(downloaded_pkg)
+ self.DownloadAndWaitForStart(file_url, windex=1)
+ self.WaitForAllDownloadsToComplete(windex=1)
incognito_downloads = self.GetDownloadsInfo(1).Downloads()
# Verify that download info exists in the correct profile.
@@ -160,7 +157,7 @@ class DownloadsTest(pyauto.PyUITest):
self._TriggerUnsafeDownload(os.path.basename(file_path))
self.PerformActionOnDownload(self._GetDownloadId(),
'save_dangerous_download')
- self.WaitForDownloadToComplete(downloaded_pkg)
+ self.WaitForAllDownloadsToComplete()
# Verify that the file was downloaded.
self.assertTrue(os.path.exists(downloaded_pkg))
@@ -188,6 +185,7 @@ class DownloadsTest(pyauto.PyUITest):
self._ClearLocalDownloadState(downloaded_pkg)
self.DownloadAndWaitForStart(file_url)
+ self.WaitForAllDownloadsToComplete()
self.PerformActionOnDownload(self._GetDownloadId(), 'remove')
# The download is removed from downloads, but not from the disk.
@@ -394,7 +392,7 @@ class DownloadsTest(pyauto.PyUITest):
'a_zip_file.zip')
self._ClearLocalDownloadState(downloaded_pkg)
self.DownloadAndWaitForStart(file_url)
- self.WaitForDownloadToComplete(downloaded_pkg)
+ self.WaitForAllDownloadsToComplete()
downloads = self.GetDownloadsInfo().Downloads()
self.assertEqual(1, len(downloads))
self.assertEqual('a_zip_file.zip', downloads[0]['file_name'])
@@ -487,11 +485,11 @@ class DownloadsTest(pyauto.PyUITest):
self._ClearLocalDownloadState(downloaded_pkg_incog)
self.DownloadAndWaitForStart(file_url, 0)
- self.WaitForAllDownloadsToComplete(0)
+ self.WaitForAllDownloadsToComplete(windex=0)
self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
self.DownloadAndWaitForStart(file_url, 1)
- self.WaitForAllDownloadsToComplete(1)
+ self.WaitForAllDownloadsToComplete(windex=1)
# Verify download in regular window.
self.assertTrue(os.path.exists(downloaded_pkg_regul))
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/test/functional/test_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698