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

Unified Diff: content/browser/download/download_browsertest.cc

Issue 1750943002: [Downloads] Stop keying TestFileErrorInjector off of URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify TestFileErrorInjector Created 4 years, 10 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/download/download_browsertest.cc ('k') | content/public/test/test_file_error_injector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_browsertest.cc
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index 40fa2a87a8dcf3c82d7a2fbfab963cc403209a83..28f164ed5788d0574bff7867b81cf45821358a1e 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -1481,11 +1481,9 @@ IN_PROC_BROWSER_TEST_P(DownloadResumptionContentTest,
DownloadManagerForShell(initiator_shell_for_resumption())));
const TestFileErrorInjector::FileErrorInfo err = {
- request_handler.url().spec(),
TestFileErrorInjector::FILE_OPERATION_INITIALIZE, 0,
DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE};
- injector->AddError(err);
- injector->InjectErrors();
+ injector->InjectError(err);
// Start and watch for interrupt.
DownloadItem* download(StartDownloadAndReturnItem(
@@ -1506,8 +1504,7 @@ IN_PROC_BROWSER_TEST_P(DownloadResumptionContentTest,
RunAllPendingInMessageLoop();
// Clear the old errors list.
- injector->ClearErrors();
- injector->InjectErrors();
+ injector->ClearError();
// Resume and watch completion.
PrepareToResume();
@@ -1526,11 +1523,9 @@ IN_PROC_BROWSER_TEST_P(DownloadResumptionContentTest,
DownloadManagerForShell(initiator_shell_for_resumption())));
const TestFileErrorInjector::FileErrorInfo err = {
- request_handler.url().spec(),
TestFileErrorInjector::FILE_OPERATION_RENAME_UNIQUIFY, 0,
DOWNLOAD_INTERRUPT_REASON_FILE_NO_SPACE};
- injector->AddError(err);
- injector->InjectErrors();
+ injector->InjectError(err);
// Start and watch for interrupt.
DownloadItem* download(StartDownloadAndReturnItem(
@@ -1553,8 +1548,7 @@ IN_PROC_BROWSER_TEST_P(DownloadResumptionContentTest,
RunAllPendingInMessageLoop();
// Clear the old errors list.
- injector->ClearErrors();
- injector->InjectErrors();
+ injector->ClearError();
PrepareToResume();
download->Resume();
@@ -1574,11 +1568,9 @@ IN_PROC_BROWSER_TEST_P(DownloadResumptionContentTest,
DownloadManagerForShell(initiator_shell_for_resumption())
->RemoveAllDownloads();
TestFileErrorInjector::FileErrorInfo err = {
- request_handler.url().spec(),
TestFileErrorInjector::FILE_OPERATION_RENAME_ANNOTATE, 0,
DOWNLOAD_INTERRUPT_REASON_FILE_FAILED};
- injector->AddError(err);
- injector->InjectErrors();
+ injector->InjectError(err);
// Start and watch for interrupt.
DownloadItem* download(StartDownloadAndReturnItem(
@@ -1598,8 +1590,7 @@ IN_PROC_BROWSER_TEST_P(DownloadResumptionContentTest,
RunAllPendingInMessageLoop();
// Clear the old errors list.
- injector->ClearErrors();
- injector->InjectErrors();
+ injector->ClearError();
PrepareToResume();
download->Resume();
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | content/public/test/test_file_error_injector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698