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

Side by Side Diff: chrome/browser/download/download_manager_unittest.cc

Issue 8770024: Added a download file factory to the download file manager, for testing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged with trunk. Created 9 years 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/i18n/number_formatting.h" 10 #include "base/i18n/number_formatting.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 scoped_refptr<DownloadIdFactory> id_factory_; 142 scoped_refptr<DownloadIdFactory> id_factory_;
143 scoped_refptr<DownloadManager> download_manager_; 143 scoped_refptr<DownloadManager> download_manager_;
144 scoped_refptr<DownloadFileManager> file_manager_; 144 scoped_refptr<DownloadFileManager> file_manager_;
145 MessageLoopForUI message_loop_; 145 MessageLoopForUI message_loop_;
146 content::TestBrowserThread ui_thread_; 146 content::TestBrowserThread ui_thread_;
147 content::TestBrowserThread file_thread_; 147 content::TestBrowserThread file_thread_;
148 scoped_refptr<content::DownloadBuffer> download_buffer_; 148 scoped_refptr<content::DownloadBuffer> download_buffer_;
149 149
150 DownloadFileManager* file_manager() { 150 DownloadFileManager* file_manager() {
151 if (!file_manager_) { 151 if (!file_manager_) {
152 file_manager_ = new DownloadFileManager(NULL); 152 file_manager_ = new DownloadFileManager(NULL, NULL);
Randy Smith (Not in Mondays) 2011/12/05 22:25:38 You should either specify what happens when you pa
ahendrickson 2011/12/07 19:55:15 Did both! Using a NULL to indicate that the defau
153 download_manager_->SetFileManager(file_manager_); 153 download_manager_->SetFileManager(file_manager_);
154 } 154 }
155 return file_manager_; 155 return file_manager_;
156 } 156 }
157 157
158 DISALLOW_COPY_AND_ASSIGN(DownloadManagerTest); 158 DISALLOW_COPY_AND_ASSIGN(DownloadManagerTest);
159 }; 159 };
160 160
161 const char* DownloadManagerTest::kTestData = "a;sdlfalsdfjalsdkfjad"; 161 const char* DownloadManagerTest::kTestData = "a;sdlfalsdfjalsdkfjad";
162 const size_t DownloadManagerTest::kTestDataLen = 162 const size_t DownloadManagerTest::kTestDataLen =
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 EXPECT_FALSE(observer->hit_state(DownloadItem::REMOVING)); 868 EXPECT_FALSE(observer->hit_state(DownloadItem::REMOVING));
869 EXPECT_TRUE(observer->was_updated()); 869 EXPECT_TRUE(observer->was_updated());
870 EXPECT_FALSE(observer->was_opened()); 870 EXPECT_FALSE(observer->was_opened());
871 EXPECT_TRUE(download->GetFileExternallyRemoved()); 871 EXPECT_TRUE(download->GetFileExternallyRemoved());
872 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState()); 872 EXPECT_EQ(DownloadItem::COMPLETE, download->GetState());
873 EXPECT_EQ(download_item_model->GetStatusText(), 873 EXPECT_EQ(download_item_model->GetStatusText(),
874 l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_REMOVED)); 874 l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_REMOVED));
875 875
876 EXPECT_FALSE(file_util::PathExists(new_path)); 876 EXPECT_FALSE(file_util::PathExists(new_path));
877 } 877 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_file_manager.h » ('j') | content/browser/download/download_file_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698