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

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

Issue 8399001: Use a DownloadRequestHandle pointer in construction to allow mocking for tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to TOT. Created 9 years, 2 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
« no previous file with comments | « no previous file | content/browser/download/download_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager_unittest.cc
diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc
index 00223ad64d83bb9f4c571bbbb618c98b2a0f3e07..3d3c0cbcacaa65cec504bf147113a1c2f83659c4 100644
--- a/chrome/browser/download/download_manager_unittest.cc
+++ b/chrome/browser/download/download_manager_unittest.cc
@@ -183,7 +183,7 @@ DownloadFileWithMockStream::DownloadFileWithMockStream(
DownloadCreateInfo* info,
DownloadManager* manager,
net::testing::MockFileStream* stream)
- : DownloadFile(info, DownloadRequestHandle(), manager) {
+ : DownloadFile(info, new DownloadRequestHandle(), manager) {
DCHECK(file_stream_ == NULL);
file_stream_.reset(stream);
}
@@ -281,7 +281,7 @@ const struct {
class MockDownloadFile : public DownloadFile {
public:
MockDownloadFile(DownloadCreateInfo* info, DownloadManager* manager)
- : DownloadFile(info, DownloadRequestHandle(), manager),
+ : DownloadFile(info, new DownloadRequestHandle(), manager),
renamed_count_(0) { }
virtual ~MockDownloadFile() { Destructed(); }
MOCK_METHOD1(Rename, net::Error(const FilePath&));
@@ -397,7 +397,7 @@ TEST_F(DownloadManagerTest, StartDownload) {
download_manager_->CreateDownloadItem(info.get(), DownloadRequestHandle());
DownloadFile* download_file(
- new DownloadFile(info.get(), DownloadRequestHandle(),
+ new DownloadFile(info.get(), new DownloadRequestHandle(),
download_manager_));
AddDownloadToFileManager(info->download_id.local(), download_file);
download_file->Initialize(false);
@@ -758,7 +758,8 @@ TEST_F(DownloadManagerTest, DownloadOverwriteTest) {
// name has been chosen, so we need to initialize the download file
// properly.
DownloadFile* download_file(
- new DownloadFile(info.get(), DownloadRequestHandle(), download_manager_));
+ new DownloadFile(info.get(), new DownloadRequestHandle(),
+ download_manager_));
download_file->Rename(cr_path);
// This creates the .crdownload version of the file.
download_file->Initialize(false);
@@ -834,7 +835,8 @@ TEST_F(DownloadManagerTest, DownloadRemoveTest) {
// name has been chosen, so we need to initialize the download file
// properly.
DownloadFile* download_file(
- new DownloadFile(info.get(), DownloadRequestHandle(), download_manager_));
+ new DownloadFile(info.get(), new DownloadRequestHandle(),
+ download_manager_));
download_file->Rename(cr_path);
// This creates the .crdownload version of the file.
download_file->Initialize(false);
« no previous file with comments | « no previous file | content/browser/download/download_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698