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

Side by Side Diff: content/browser/download/download_browsertest.cc

Issue 2593183002: [downloads] Remove DownloadManager::RemoveAllDownloads. (Closed)
Patch Set: Fix SavePageBrowsertest Created 3 years, 12 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains download browser tests that are known to be runnable 5 // This file contains download browser tests that are known to be runnable
6 // in a pure content context. Over time tests should be migrated here. 6 // in a pure content context. Over time tests should be migrated here.
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <utility> 10 #include <utility>
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 } 1504 }
1505 1505
1506 IN_PROC_BROWSER_TEST_F(DownloadContentTest, RecoverFromFinalRenameError) { 1506 IN_PROC_BROWSER_TEST_F(DownloadContentTest, RecoverFromFinalRenameError) {
1507 TestDownloadRequestHandler request_handler; 1507 TestDownloadRequestHandler request_handler;
1508 request_handler.StartServing(TestDownloadRequestHandler::Parameters()); 1508 request_handler.StartServing(TestDownloadRequestHandler::Parameters());
1509 1509
1510 // Setup the error injector. 1510 // Setup the error injector.
1511 scoped_refptr<TestFileErrorInjector> injector( 1511 scoped_refptr<TestFileErrorInjector> injector(
1512 TestFileErrorInjector::Create(DownloadManagerForShell(shell()))); 1512 TestFileErrorInjector::Create(DownloadManagerForShell(shell())));
1513 1513
1514 DownloadManagerForShell(shell())->RemoveAllDownloads();
1515 TestFileErrorInjector::FileErrorInfo err = { 1514 TestFileErrorInjector::FileErrorInfo err = {
1516 TestFileErrorInjector::FILE_OPERATION_RENAME_ANNOTATE, 0, 1515 TestFileErrorInjector::FILE_OPERATION_RENAME_ANNOTATE, 0,
1517 DOWNLOAD_INTERRUPT_REASON_FILE_FAILED}; 1516 DOWNLOAD_INTERRUPT_REASON_FILE_FAILED};
1518 injector->InjectError(err); 1517 injector->InjectError(err);
1519 1518
1520 // Start and watch for interrupt. 1519 // Start and watch for interrupt.
1521 DownloadItem* download( 1520 DownloadItem* download(
1522 StartDownloadAndReturnItem(shell(), request_handler.url())); 1521 StartDownloadAndReturnItem(shell(), request_handler.url()));
1523 WaitForInterrupt(download); 1522 WaitForInterrupt(download);
1524 ASSERT_EQ(DownloadItem::INTERRUPTED, download->GetState()); 1523 ASSERT_EQ(DownloadItem::INTERRUPTED, download->GetState());
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
2637 GURL document_url = 2636 GURL document_url =
2638 origin_two.GetURL("/iframe-host.html?target=" + frame_url.spec()); 2637 origin_two.GetURL("/iframe-host.html?target=" + frame_url.spec());
2639 DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url); 2638 DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url);
2640 WaitForCompletion(download); 2639 WaitForCompletion(download);
2641 2640
2642 EXPECT_STREQ(FILE_PATH_LITERAL("download-test.lib"), 2641 EXPECT_STREQ(FILE_PATH_LITERAL("download-test.lib"),
2643 download->GetTargetFilePath().BaseName().value().c_str()); 2642 download->GetTargetFilePath().BaseName().value().c_str());
2644 } 2643 }
2645 2644
2646 } // namespace content 2645 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698