summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_manager_unittest.cc
diff options
context:
space:
mode:
authorahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-08 21:04:35 +0000
committerahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-08 21:04:35 +0000
commit159ffc1ba1d4846e7b7c459f5c098c581436ef82 (patch)
tree82eef793016f56b5a18bdd7052fa1b56795fe395 /chrome/browser/download/download_manager_unittest.cc
parentc4f3213f503fe2114a16029c967f55fcaeb4a6bb (diff)
downloadchromium_src-159ffc1ba1d4846e7b7c459f5c098c581436ef82.zip
chromium_src-159ffc1ba1d4846e7b7c459f5c098c581436ef82.tar.gz
chromium_src-159ffc1ba1d4846e7b7c459f5c098c581436ef82.tar.bz2
Added a download file factory to the download file manager, for testing.
BUG=None TEST=None Review URL: http://codereview.chromium.org/8770024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113658 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_manager_unittest.cc')
-rw-r--r--chrome/browser/download/download_manager_unittest.cc25
1 files changed, 24 insertions, 1 deletions
diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc
index b99007e..4bd969d 100644
--- a/chrome/browser/download/download_manager_unittest.cc
+++ b/chrome/browser/download/download_manager_unittest.cc
@@ -55,6 +55,28 @@
#define MAYBE_DownloadRemoveTest DownloadRemoveTest
#endif
+namespace {
+
+class MockDownloadFileFactory
+ : public DownloadFileManager::DownloadFileFactory {
+ public:
+ MockDownloadFileFactory() {}
+
+ virtual DownloadFile* CreateFile(DownloadCreateInfo* info,
+ const DownloadRequestHandle& request_handle,
+ DownloadManager* download_manager) OVERRIDE;
+};
+
+DownloadFile* MockDownloadFileFactory::CreateFile(
+ DownloadCreateInfo* info,
+ const DownloadRequestHandle& request_handle,
+ DownloadManager* download_manager) {
+ NOTREACHED();
+ return NULL;
+}
+
+} // namespace
+
using content::BrowserThread;
DownloadId::Domain kValidIdDomain = "valid DownloadId::Domain";
@@ -149,7 +171,8 @@ class DownloadManagerTest : public testing::Test {
DownloadFileManager* file_manager() {
if (!file_manager_) {
- file_manager_ = new DownloadFileManager(NULL);
+ file_manager_ = new DownloadFileManager(NULL,
+ new MockDownloadFileFactory);
download_manager_->SetFileManager(file_manager_);
}
return file_manager_;