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

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

Issue 2799333002: Clear the received slices in DownloadItemImpl when etag changed. (Closed)
Patch Set: Address the uma issue. Created 3 years, 8 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.cc » ('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 99ae97d445972d2af39ff776c2b70501887a93eb..4bc430e2547808fd7a29f760dd46b037c0849382 100644
--- a/content/browser/download/download_file_unittest.cc
+++ b/content/browser/download/download_file_unittest.cc
@@ -122,13 +122,11 @@ class TestDownloadFileImpl : public DownloadFileImpl {
std::unique_ptr<DownloadSaveInfo> save_info,
const base::FilePath& default_downloads_directory,
std::unique_ptr<ByteStreamReader> stream,
- const std::vector<DownloadItem::ReceivedSlice>& received_slices,
const net::NetLogWithSource& net_log,
base::WeakPtr<DownloadDestinationObserver> observer)
: DownloadFileImpl(std::move(save_info),
default_downloads_directory,
std::move(stream),
- received_slices,
net_log,
observer) {}
@@ -231,7 +229,7 @@ class DownloadFileTest : public testing::Test {
download_file_.reset(new TestDownloadFileImpl(
std::move(save_info), base::FilePath(),
- std::unique_ptr<ByteStreamReader>(input_stream_), received_slices,
+ std::unique_ptr<ByteStreamReader>(input_stream_),
net::NetLogWithSource(), observer_factory_.GetWeakPtr()));
EXPECT_CALL(*input_stream_, Read(_, _))
@@ -241,9 +239,11 @@ class DownloadFileTest : public testing::Test {
base::WeakPtrFactory<DownloadFileTest> weak_ptr_factory(this);
DownloadInterruptReason result = DOWNLOAD_INTERRUPT_REASON_NONE;
base::RunLoop loop_runner;
- download_file_->Initialize(base::Bind(
- &DownloadFileTest::SetInterruptReasonCallback,
- weak_ptr_factory.GetWeakPtr(), loop_runner.QuitClosure(), &result));
+ download_file_->Initialize(
+ base::Bind(&DownloadFileTest::SetInterruptReasonCallback,
+ weak_ptr_factory.GetWeakPtr(), loop_runner.QuitClosure(),
+ &result),
+ received_slices);
loop_runner.Run();
::testing::Mock::VerifyAndClearExpectations(input_stream_);
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/download_item_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698