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

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

Issue 10900010: Remove DownloadFileManager in favor of direct ownership of DownloadFiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporating comments. Created 8 years, 3 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 | « chrome/browser/download/save_page_browsertest.cc ('k') | content/browser/browser_context.cc » ('j') | 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/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 logging.info('The download completed before pause. Stopping test.') 362 logging.info('The download completed before pause. Stopping test.')
363 return 363 return
364 364
365 self.assertTrue(pause_dict['is_paused']) 365 self.assertTrue(pause_dict['is_paused'])
366 self.assertTrue(pause_dict['state'] == 'IN_PROGRESS') 366 self.assertTrue(pause_dict['state'] == 'IN_PROGRESS')
367 367
368 # Resume the download and assert it is not paused. 368 # Resume the download and assert it is not paused.
369 resume_dict = self.PerformActionOnDownload(self._GetDownloadId(), 369 resume_dict = self.PerformActionOnDownload(self._GetDownloadId(),
370 'toggle_pause') 370 'toggle_pause')
371 self.assertFalse(resume_dict['is_paused']) 371 self.assertFalse(resume_dict['is_paused'])
372 self.WaitForAllDownloadsToComplete(timeout=self.large_test_timeout_ms()); 372 self.WaitForAllDownloadsToComplete(timeout=10 * 60 * 1000);
373 373
374 # Verify that the file was correctly downloaded after pause and resume. 374 # Verify that the file was correctly downloaded after pause and resume.
375 self.assertTrue(os.path.exists(downloaded_pkg), 375 self.assertTrue(os.path.exists(downloaded_pkg),
376 'Downloaded file %s missing.' % downloaded_pkg) 376 'Downloaded file %s missing.' % downloaded_pkg)
377 self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg), 377 self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg),
378 'Downloaded file %s does not match original' % 378 'Downloaded file %s does not match original' %
379 downloaded_pkg) 379 downloaded_pkg)
380 380
381 def testCancelDownload(self): 381 def testCancelDownload(self):
382 """Verify that we can cancel a download.""" 382 """Verify that we can cancel a download."""
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 # Verify download in incognito window. 507 # Verify download in incognito window.
508 # bug 69738 WaitForAllDownloadsToComplete is flaky for this test case. 508 # bug 69738 WaitForAllDownloadsToComplete is flaky for this test case.
509 # Using extra WaitUntil until this is resolved. 509 # Using extra WaitUntil until this is resolved.
510 self.assertTrue(self.WaitUntil( 510 self.assertTrue(self.WaitUntil(
511 lambda: os.path.exists(downloaded_pkg_incog))) 511 lambda: os.path.exists(downloaded_pkg_incog)))
512 self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg_incog)) 512 self.assertTrue(self._EqualFileContents(file_path, downloaded_pkg_incog))
513 513
514 514
515 if __name__ == '__main__': 515 if __name__ == '__main__':
516 pyauto_functional.Main() 516 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/browser/download/save_page_browsertest.cc ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698