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

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

Issue 10905284: Use the user's preferred downloads directory for creating the initial download file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 #include <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 DownloadItem*, const base::Closure&)); 174 DownloadItem*, const base::Closure&));
175 MOCK_METHOD1(ShouldOpenDownload, bool(DownloadItem*)); 175 MOCK_METHOD1(ShouldOpenDownload, bool(DownloadItem*));
176 MOCK_METHOD0(GenerateFileHash, bool()); 176 MOCK_METHOD0(GenerateFileHash, bool());
177 MOCK_METHOD1(AddItemToPersistentStore, void(DownloadItem*)); 177 MOCK_METHOD1(AddItemToPersistentStore, void(DownloadItem*));
178 MOCK_METHOD1(UpdateItemInPersistentStore, void(DownloadItem*)); 178 MOCK_METHOD1(UpdateItemInPersistentStore, void(DownloadItem*));
179 MOCK_METHOD2(UpdatePathForItemInPersistentStore, 179 MOCK_METHOD2(UpdatePathForItemInPersistentStore,
180 void(DownloadItem*, const FilePath&)); 180 void(DownloadItem*, const FilePath&));
181 MOCK_METHOD1(RemoveItemFromPersistentStore, void(DownloadItem*)); 181 MOCK_METHOD1(RemoveItemFromPersistentStore, void(DownloadItem*));
182 MOCK_METHOD2(RemoveItemsFromPersistentStoreBetween, void( 182 MOCK_METHOD2(RemoveItemsFromPersistentStoreBetween, void(
183 base::Time remove_begin, base::Time remove_end)); 183 base::Time remove_begin, base::Time remove_end));
184 MOCK_METHOD4(GetSaveDir, void(WebContents*, FilePath*, FilePath*, bool*)); 184 MOCK_METHOD4(GetSaveDir, void(content::BrowserContext*,
185 FilePath*, FilePath*, bool*));
185 MOCK_METHOD5(ChooseSavePath, void( 186 MOCK_METHOD5(ChooseSavePath, void(
186 WebContents*, const FilePath&, const FilePath::StringType&, 187 WebContents*, const FilePath&, const FilePath::StringType&,
187 bool, const content::SavePackagePathPickedCallback&)); 188 bool, const content::SavePackagePathPickedCallback&));
188 }; 189 };
189 190
190 MockDownloadManagerDelegate::MockDownloadManagerDelegate() {} 191 MockDownloadManagerDelegate::MockDownloadManagerDelegate() {}
191 192
192 MockDownloadManagerDelegate::~MockDownloadManagerDelegate() {} 193 MockDownloadManagerDelegate::~MockDownloadManagerDelegate() {}
193 194
194 class MockDownloadFileManager : public DownloadFileManager { 195 class MockDownloadFileManager : public DownloadFileManager {
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 UpdateItemInPersistentStore(&item)); 647 UpdateItemInPersistentStore(&item));
647 EXPECT_CALL(item, GetState()) 648 EXPECT_CALL(item, GetState())
648 .WillRepeatedly(Return(DownloadItem::CANCELLED)); 649 .WillRepeatedly(Return(DownloadItem::CANCELLED));
649 EXPECT_CALL(item, GetDbHandle()) 650 EXPECT_CALL(item, GetDbHandle())
650 .WillRepeatedly(Return(db_handle)); 651 .WillRepeatedly(Return(db_handle));
651 652
652 EXPECT_CALL(item, OffThreadCancel()); 653 EXPECT_CALL(item, OffThreadCancel());
653 DownloadStopped(&item); 654 DownloadStopped(&item);
654 EXPECT_EQ(NULL, download_manager_->GetActiveDownloadItem(download_id)); 655 EXPECT_EQ(NULL, download_manager_->GetActiveDownloadItem(download_id));
655 } 656 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698