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

Unified Diff: content/browser/download/download_file_unittest.cc

Issue 148133007: [Downloads] Always call DM::StartDownload() for explicit downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typos Created 4 years, 10 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 | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/download_item_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_file_unittest.cc
diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc
index 9630a49b0662a3c79427c624ff078031bc593563..245fdcd078312e9f26fbd6356760999eef5d75da 100644
--- a/content/browser/download/download_file_unittest.cc
+++ b/content/browser/download/download_file_unittest.cc
@@ -75,19 +75,21 @@ typedef void (DownloadFile::*DownloadFileRenameMethodType)(
// retries renames failed due to ACCESS_DENIED.
class TestDownloadFileImpl : public DownloadFileImpl {
public:
- TestDownloadFileImpl(scoped_ptr<DownloadSaveInfo> save_info,
+ TestDownloadFileImpl(const DownloadSaveInfo& save_info,
const base::FilePath& default_downloads_directory,
const GURL& url,
const GURL& referrer_url,
bool calculate_hash,
+ base::File file,
scoped_ptr<ByteStreamReader> stream,
const net::BoundNetLog& bound_net_log,
base::WeakPtr<DownloadDestinationObserver> observer)
- : DownloadFileImpl(std::move(save_info),
+ : DownloadFileImpl(save_info,
default_downloads_directory,
url,
referrer_url,
calculate_hash,
+ std::move(file),
std::move(stream),
bound_net_log,
observer) {}
@@ -176,15 +178,14 @@ class DownloadFileTest : public testing::Test {
.RetiresOnSaturation();
scoped_ptr<DownloadSaveInfo> save_info(new DownloadSaveInfo());
- scoped_ptr<TestDownloadFileImpl> download_file_impl(
- new TestDownloadFileImpl(
- std::move(save_info), base::FilePath(),
- GURL(), // Source
- GURL(), // Referrer
- calculate_hash, scoped_ptr<ByteStreamReader>(input_stream_),
- net::BoundNetLog(), observer_factory_.GetWeakPtr()));
- download_file_impl->SetClientGuid("12345678-ABCD-1234-DCBA-123456789ABC");
- download_file_ = std::move(download_file_impl);
+ download_file_.reset(new TestDownloadFileImpl(
+ *save_info, base::FilePath(),
+ GURL(), // Source
+ GURL(), // Referrer
+ calculate_hash, std::move(save_info->file),
+ scoped_ptr<ByteStreamReader>(input_stream_), net::BoundNetLog(),
+ observer_factory_.GetWeakPtr()));
+ download_file_->SetClientGuid("12345678-ABCD-1234-DCBA-123456789ABC");
EXPECT_CALL(*input_stream_, Read(_, _))
.WillOnce(Return(ByteStreamReader::STREAM_EMPTY))
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/download_item_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698