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

Unified Diff: chrome/browser/download/download_target_determiner_unittest.cc

Issue 148133007: [Downloads] Always call DM::StartDownload() for explicit downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: chrome/browser/download/download_target_determiner_unittest.cc
diff --git a/chrome/browser/download/download_target_determiner_unittest.cc b/chrome/browser/download/download_target_determiner_unittest.cc
index 104cb246d2842ac74f4d237bd820d6729631d811..a34ab5befb2edf7dcb70d473c890ba7b60091afa 100644
--- a/chrome/browser/download/download_target_determiner_unittest.cc
+++ b/chrome/browser/download/download_target_determiner_unittest.cc
@@ -923,10 +923,10 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_InactiveDownload) {
"http://example.com/foo.txt", "text/plain",
FILE_PATH_LITERAL(""),
- FILE_PATH_LITERAL(""),
+ FILE_PATH_LITERAL("foo.txt"),
DownloadItem::TARGET_DISPOSITION_OVERWRITE,
- EXPECT_LOCAL_PATH
+ EXPECT_CRDOWNLOAD
},
{
@@ -935,10 +935,10 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_InactiveDownload) {
"http://example.com/foo.txt", "text/plain",
FILE_PATH_LITERAL(""),
- FILE_PATH_LITERAL(""),
+ FILE_PATH_LITERAL("foo.txt"),
DownloadItem::TARGET_DISPOSITION_PROMPT,
- EXPECT_LOCAL_PATH
+ EXPECT_CRDOWNLOAD
}
};
@@ -949,10 +949,13 @@ TEST_F(DownloadTargetDeterminerTest, TargetDeterminer_InactiveDownload) {
CreateActiveDownloadItem(i, test_case));
EXPECT_CALL(*item.get(), GetState())
.WillRepeatedly(Return(content::DownloadItem::CANCELLED));
- // Even though one is a SAVE_AS download, no prompt will be displayed to
- // the user because the download is inactive.
- EXPECT_CALL(*delegate(), PromptUserForDownloadPath(_, _, _))
- .Times(0);
+
+ // The following delegate methods should not be invoked for an inactive
+ // download.
+ EXPECT_CALL(*delegate(), PromptUserForDownloadPath(_, _, _)).Times(0);
+ EXPECT_CALL(*delegate(), NotifyExtensions(_, _, _)).Times(0);
+ EXPECT_CALL(*delegate(), ReserveVirtualPath(_, _, _, _, _)).Times(0);
+ EXPECT_CALL(*delegate(), DetermineLocalPath(_, _, _)).Times(1);
RunTestCase(test_case, base::FilePath(), item.get());
}
}

Powered by Google App Engine
This is Rietveld 408576698