| 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 <map> | 10 #include <map> |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 virtual ~MockDownloadFileFactory() {} | 290 virtual ~MockDownloadFileFactory() {} |
| 291 | 291 |
| 292 // Overridden method from DownloadFileFactory | 292 // Overridden method from DownloadFileFactory |
| 293 MOCK_METHOD2(MockCreateFile, | 293 MOCK_METHOD2(MockCreateFile, |
| 294 MockDownloadFile*(const DownloadSaveInfo&, ByteStreamReader*)); | 294 MockDownloadFile*(const DownloadSaveInfo&, ByteStreamReader*)); |
| 295 | 295 |
| 296 DownloadFile* CreateFile( | 296 DownloadFile* CreateFile( |
| 297 std::unique_ptr<DownloadSaveInfo> save_info, | 297 std::unique_ptr<DownloadSaveInfo> save_info, |
| 298 const base::FilePath& default_download_directory, | 298 const base::FilePath& default_download_directory, |
| 299 std::unique_ptr<ByteStreamReader> byte_stream, | 299 std::unique_ptr<ByteStreamReader> byte_stream, |
| 300 const std::vector<DownloadItem::ReceivedSlice>& received_slices, | |
| 301 const net::NetLogWithSource& net_log, | 300 const net::NetLogWithSource& net_log, |
| 302 base::WeakPtr<DownloadDestinationObserver> observer) override { | 301 base::WeakPtr<DownloadDestinationObserver> observer) override { |
| 303 return MockCreateFile(*save_info, byte_stream.get()); | 302 return MockCreateFile(*save_info, byte_stream.get()); |
| 304 } | 303 } |
| 305 }; | 304 }; |
| 306 | 305 |
| 307 class MockBrowserContext : public BrowserContext { | 306 class MockBrowserContext : public BrowserContext { |
| 308 public: | 307 public: |
| 309 MockBrowserContext() { | 308 MockBrowserContext() { |
| 310 content::BrowserContext::Initialize(this, base::FilePath()); | 309 content::BrowserContext::Initialize(this, base::FilePath()); |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); | 648 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); |
| 650 | 649 |
| 651 base::Callback<bool(const GURL&)> url_filter = | 650 base::Callback<bool(const GURL&)> url_filter = |
| 652 GetSingleURLFilter(download_urls_[0]); | 651 GetSingleURLFilter(download_urls_[0]); |
| 653 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( | 652 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( |
| 654 url_filter, base::Time(), base::Time::Max()); | 653 url_filter, base::Time(), base::Time::Max()); |
| 655 EXPECT_EQ(remove_count, 1); | 654 EXPECT_EQ(remove_count, 1); |
| 656 } | 655 } |
| 657 | 656 |
| 658 } // namespace content | 657 } // namespace content |
| OLD | NEW |