| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |