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

Side by Side Diff: chrome/test/functional/instant.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import cgi 7 import cgi
8 import os 8 import os
9 9
10 import pyauto_functional # Must be imported before pyauto 10 import pyauto_functional # Must be imported before pyauto
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 def _AssertInstantDoesNotDownloadFile(self, path): 222 def _AssertInstantDoesNotDownloadFile(self, path):
223 """Asserts instant does not download the specified file. 223 """Asserts instant does not download the specified file.
224 224
225 Args: 225 Args:
226 path: Path to file. 226 path: Path to file.
227 """ 227 """
228 self.NavigateToURL('chrome://downloads') 228 self.NavigateToURL('chrome://downloads')
229 filepath = self.GetFileURLForDataPath(path) 229 filepath = self.GetFileURLForDataPath(path)
230 self.SetOmniboxText(filepath) 230 self.SetOmniboxText(filepath)
231 self.WaitUntilOmniboxQueryDone() 231 self.WaitUntilOmniboxQueryDone()
232 self.WaitForAllDownloadsToComplete() 232 self.WaitForAllDownloadsToComplete([])
233 self.assertFalse(self.GetDownloadsInfo().Downloads(), 233 self.assertFalse(self.GetDownloadsInfo().Downloads(),
234 msg='Should not download: %s' % filepath) 234 msg='Should not download: %s' % filepath)
235 235
236 def testInstantDoesNotDownloadZipFile(self): 236 def testInstantDoesNotDownloadZipFile(self):
237 """Test that instant does not download zip file.""" 237 """Test that instant does not download zip file."""
238 self._AssertInstantDoesNotDownloadFile(os.path.join('zip', 'test.zip')) 238 self._AssertInstantDoesNotDownloadFile(os.path.join('zip', 'test.zip'))
239 239
240 def testInstantDoesNotDownloadPDFFile(self): 240 def testInstantDoesNotDownloadPDFFile(self):
241 """Test that instant does not download PDF file.""" 241 """Test that instant does not download PDF file."""
242 self._AssertInstantDoesNotDownloadFile(os.path.join('printing', 242 self._AssertInstantDoesNotDownloadFile(os.path.join('printing',
(...skipping 24 matching lines...) Expand all
267 """Test that instant loads PNG file.""" 267 """Test that instant loads PNG file."""
268 self._AssertInstantLoadsFile(os.path.join('save_page', '1.png')) 268 self._AssertInstantLoadsFile(os.path.join('save_page', '1.png'))
269 269
270 def testInstantLoadsSVG(self): 270 def testInstantLoadsSVG(self):
271 """Test that instant loads SVG file.""" 271 """Test that instant loads SVG file."""
272 self._AssertInstantLoadsFile(os.path.join('circle.svg')) 272 self._AssertInstantLoadsFile(os.path.join('circle.svg'))
273 273
274 274
275 if __name__ == '__main__': 275 if __name__ == '__main__':
276 pyauto_functional.Main() 276 pyauto_functional.Main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698