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

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

Issue 10704052: Download filename determination refactor (3/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: BrowsingDataRemover calls CDMD directly Created 8 years, 5 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: content/browser/download/download_manager_impl_unittest.cc
diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc
index 50c226fcc4ebfc95547cb79136338f6342c40ed2..c8755a175ae222f8bab1bcec59494b23668bfb84 100644
--- a/content/browser/download/download_manager_impl_unittest.cc
+++ b/content/browser/download/download_manager_impl_unittest.cc
@@ -60,7 +60,6 @@ class MockDownloadManagerDelegate : public content::DownloadManagerDelegate {
MOCK_METHOD0(Shutdown, void());
MOCK_METHOD0(GetNextId, content::DownloadId());
MOCK_METHOD1(ShouldStartDownload, bool(int32));
- MOCK_METHOD1(ChooseDownloadPath, void(DownloadItem*));
MOCK_METHOD1(GetIntermediatePath, FilePath(const DownloadItem&));
MOCK_METHOD0(GetAlternativeWebContentsToNotifyForDownload, WebContents*());
MOCK_METHOD1(ShouldOpenFileBasedOnExtension, bool(const FilePath&));
@@ -456,29 +455,6 @@ TEST_F(DownloadManagerTest, StartDownload) {
EXPECT_TRUE(GetActiveDownloadItem(local_id));
}
-// Does the DownloadManager prompt when requested?
-TEST_F(DownloadManagerTest, RestartDownload) {
- // Put a mock we have a handle to on the download manager.
- content::MockDownloadItem& item(AddItemToManager());
- int download_id = item.GetId();
-
- // Confirm we're internally consistent.
- EXPECT_EQ(&item, GetActiveDownloadItem(download_id));
-
- ScopedTempDir download_dir;
- ASSERT_TRUE(download_dir.CreateUniqueTempDir());
- FilePath expected_path(download_dir.path().Append(
- FILE_PATH_LITERAL("location")));
-
- EXPECT_CALL(item, GetTargetDisposition())
- .WillOnce(Return(DownloadItem::TARGET_DISPOSITION_PROMPT));
- EXPECT_CALL(GetMockDownloadManagerDelegate(), ChooseDownloadPath(&item));
- download_manager_->RestartDownload(download_id);
-
- // The alternative pathway goes straight to OnTargetPathAvailable,
- // so it more naturally belongs below.
-}
-
// Do the results of GetIntermediatePath get passed through to the
// download? Note that this path is tested from RestartDownload
// to test the non-prompting path in RestartDownload as well.
@@ -493,8 +469,6 @@ TEST_F(DownloadManagerTest, OnTargetPathAvailable) {
FilePath intermediate_path(download_dir.path().Append(
FILE_PATH_LITERAL("location.crdownload")));
- EXPECT_CALL(item, GetTargetDisposition())
- .WillOnce(Return(DownloadItem::TARGET_DISPOSITION_OVERWRITE));
EXPECT_CALL(GetMockDownloadManagerDelegate(),
GetIntermediatePath(Ref(item)))
.WillOnce(Return(intermediate_path));

Powered by Google App Engine
This is Rietveld 408576698