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

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: Fixed compile error. 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') | content/browser/download/download_item.cc » ('J')
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 feccbe804f4d77a2c11c0cdfb20a7e31730fc1f5..483c33ac38d6db71ec2003253bd36bd5d2dbffc3 100644
--- a/chrome/browser/download/download_manager_unittest.cc
+++ b/chrome/browser/download/download_manager_unittest.cc
@@ -176,7 +176,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);
}
@@ -274,7 +274,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&));
@@ -390,7 +390,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, download_file);
download_file->Initialize(false);
@@ -751,7 +751,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);
@@ -827,7 +828,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') | content/browser/download/download_item.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698