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

Side by Side Diff: chrome/test/functional/downloads.py

Issue 6275016: Fix flaky testZipInIncognito (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import commands 6 import commands
7 import filecmp 7 import filecmp
8 import logging 8 import logging
9 import os 9 import os
10 import shutil 10 import shutil
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 file_path = os.path.join(test_dir, 'a_zip_file.zip') 131 file_path = os.path.join(test_dir, 'a_zip_file.zip')
132 file_url = self.GetFileURLForPath(file_path) 132 file_url = self.GetFileURLForPath(file_path)
133 downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(), 133 downloaded_pkg = os.path.join(self.GetDownloadDirectory().value(),
134 'a_zip_file.zip') 134 'a_zip_file.zip')
135 self._ClearLocalDownloadState(downloaded_pkg) 135 self._ClearLocalDownloadState(downloaded_pkg)
136 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW) 136 self.RunCommand(pyauto.IDC_NEW_INCOGNITO_WINDOW)
137 137
138 # Trigger download and wait in new incognito window. 138 # Trigger download and wait in new incognito window.
139 self.DownloadAndWaitForStart(file_url, 1) 139 self.DownloadAndWaitForStart(file_url, 1)
140 self.WaitForAllDownloadsToComplete(1) 140 self.WaitForAllDownloadsToComplete(1)
141 # Remove next line when WaitForAllDownloadsToComplete can reliably wait
142 # for downloads in incognito window. crbug.com/69738
143 self.WaitForDownloadToComplete(downloaded_pkg)
141 incognito_downloads = self.GetDownloadsInfo(1).Downloads() 144 incognito_downloads = self.GetDownloadsInfo(1).Downloads()
142 145
143 # Verify that download info exists in the correct profile. 146 # Verify that download info exists in the correct profile.
144 self.assertEqual(len(incognito_downloads), 1) 147 self.assertEqual(len(incognito_downloads), 1)
145 self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg), 148 self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg),
146 msg='%s (size %d) and %s (size %d) do not match' % ( 149 msg='%s (size %d) and %s (size %d) do not match' % (
147 file_path, os.path.getsize(file_path), 150 file_path, os.path.getsize(file_path),
148 downloaded_pkg, os.path.getsize(downloaded_pkg))) 151 downloaded_pkg, os.path.getsize(downloaded_pkg)))
149 self.assertTrue(self.IsDownloadShelfVisible(1)) 152 self.assertTrue(self.IsDownloadShelfVisible(1))
150 153
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 # Verify download in incognito window. 593 # Verify download in incognito window.
591 # bug 69738 WaitForAllDownloadsToComplete is flaky for this test case. 594 # bug 69738 WaitForAllDownloadsToComplete is flaky for this test case.
592 # Using extra WaitUntil until this is resolved. 595 # Using extra WaitUntil until this is resolved.
593 self.assertTrue(self.WaitUntil( 596 self.assertTrue(self.WaitUntil(
594 lambda: os.path.exists(downloaded_pkg_incog))) 597 lambda: os.path.exists(downloaded_pkg_incog)))
595 self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg_incog)) 598 self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg_incog))
596 599
597 600
598 if __name__ == '__main__': 601 if __name__ == '__main__':
599 pyauto_functional.Main() 602 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698