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

Side by Side Diff: content/browser/download/download_manager_impl_unittest.cc

Issue 2734493003: Pass slice info to DownloadFileImpl (Closed)
Patch Set: rebase Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/download/download_manager_impl.h" 5 #include "content/browser/download/download_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 virtual ~MockDownloadFileFactory() {} 287 virtual ~MockDownloadFileFactory() {}
288 288
289 // Overridden method from DownloadFileFactory 289 // Overridden method from DownloadFileFactory
290 MOCK_METHOD2(MockCreateFile, 290 MOCK_METHOD2(MockCreateFile,
291 MockDownloadFile*(const DownloadSaveInfo&, ByteStreamReader*)); 291 MockDownloadFile*(const DownloadSaveInfo&, ByteStreamReader*));
292 292
293 virtual DownloadFile* CreateFile( 293 virtual DownloadFile* CreateFile(
294 std::unique_ptr<DownloadSaveInfo> save_info, 294 std::unique_ptr<DownloadSaveInfo> save_info,
295 const base::FilePath& default_download_directory, 295 const base::FilePath& default_download_directory,
296 std::unique_ptr<ByteStreamReader> byte_stream, 296 std::unique_ptr<ByteStreamReader> byte_stream,
297 const std::vector<DownloadItem::ReceivedSlice>& received_slices,
297 const net::NetLogWithSource& net_log, 298 const net::NetLogWithSource& net_log,
298 base::WeakPtr<DownloadDestinationObserver> observer) override { 299 base::WeakPtr<DownloadDestinationObserver> observer) override {
299 return MockCreateFile(*save_info, byte_stream.get()); 300 return MockCreateFile(*save_info, byte_stream.get());
300 } 301 }
301 }; 302 };
302 303
303 class MockBrowserContext : public BrowserContext { 304 class MockBrowserContext : public BrowserContext {
304 public: 305 public:
305 MockBrowserContext() { 306 MockBrowserContext() {
306 content::BrowserContext::Initialize(this, base::FilePath()); 307 content::BrowserContext::Initialize(this, base::FilePath());
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); 640 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0);
640 641
641 base::Callback<bool(const GURL&)> url_filter = 642 base::Callback<bool(const GURL&)> url_filter =
642 GetSingleURLFilter(download_urls_[0]); 643 GetSingleURLFilter(download_urls_[0]);
643 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( 644 int remove_count = download_manager_->RemoveDownloadsByURLAndTime(
644 url_filter, base::Time(), base::Time::Max()); 645 url_filter, base::Time(), base::Time::Max());
645 EXPECT_EQ(remove_count, 1); 646 EXPECT_EQ(remove_count, 1);
646 } 647 }
647 648
648 } // namespace content 649 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | content/public/test/test_file_error_injector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698