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 <set> | 10 #include <set> |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 const base::FilePath& partition_path, bool in_memory)); | 426 const base::FilePath& partition_path, bool in_memory)); |
427 MOCK_METHOD0(GetResourceContext, ResourceContext*()); | 427 MOCK_METHOD0(GetResourceContext, ResourceContext*()); |
428 MOCK_METHOD0(GetDownloadManagerDelegate, DownloadManagerDelegate*()); | 428 MOCK_METHOD0(GetDownloadManagerDelegate, DownloadManagerDelegate*()); |
429 MOCK_METHOD0(GetGuestManager, BrowserPluginGuestManager* ()); | 429 MOCK_METHOD0(GetGuestManager, BrowserPluginGuestManager* ()); |
430 MOCK_METHOD0(GetSpecialStoragePolicy, storage::SpecialStoragePolicy*()); | 430 MOCK_METHOD0(GetSpecialStoragePolicy, storage::SpecialStoragePolicy*()); |
431 MOCK_METHOD0(GetPushMessagingService, PushMessagingService*()); | 431 MOCK_METHOD0(GetPushMessagingService, PushMessagingService*()); |
432 MOCK_METHOD0(GetSSLHostStateDelegate, SSLHostStateDelegate*()); | 432 MOCK_METHOD0(GetSSLHostStateDelegate, SSLHostStateDelegate*()); |
433 MOCK_METHOD0(GetPermissionManager, PermissionManager*()); | 433 MOCK_METHOD0(GetPermissionManager, PermissionManager*()); |
434 MOCK_METHOD0(GetBackgroundSyncController, BackgroundSyncController*()); | 434 MOCK_METHOD0(GetBackgroundSyncController, BackgroundSyncController*()); |
435 | 435 |
| 436 // Define these two methods to avoid a |
| 437 // cannot access private member declared in class 'ScopedVector<net::URLReques
tInterceptor>' |
| 438 // build error if they're put in MOCK_METHOD. |
| 439 net::URLRequestContextGetter* CreateRequestContext( |
| 440 ProtocolHandlerMap* protocol_handlers, |
| 441 URLRequestInterceptorScopedVector request_interceptors) override { |
| 442 return nullptr; |
| 443 } |
| 444 |
| 445 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( |
| 446 const base::FilePath& partition_path, |
| 447 bool in_memory, |
| 448 ProtocolHandlerMap* protocol_handlers, |
| 449 URLRequestInterceptorScopedVector request_interceptors) override { |
| 450 return nullptr; |
| 451 } |
| 452 |
436 scoped_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( | 453 scoped_ptr<ZoomLevelDelegate> CreateZoomLevelDelegate( |
437 const base::FilePath& path) override { | 454 const base::FilePath& path) override { |
438 return scoped_ptr<ZoomLevelDelegate>(CreateZoomLevelDelegateMock(path)); | 455 return scoped_ptr<ZoomLevelDelegate>(CreateZoomLevelDelegateMock(path)); |
439 } | 456 } |
440 }; | 457 }; |
441 | 458 |
442 class MockDownloadManagerObserver : public DownloadManager::Observer { | 459 class MockDownloadManagerObserver : public DownloadManager::Observer { |
443 public: | 460 public: |
444 MockDownloadManagerObserver() {} | 461 MockDownloadManagerObserver() {} |
445 ~MockDownloadManagerObserver() {} | 462 ~MockDownloadManagerObserver() {} |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); | 791 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); |
775 | 792 |
776 base::Callback<bool(const GURL&)> url_filter = | 793 base::Callback<bool(const GURL&)> url_filter = |
777 GetSingleURLFilter(download_urls_[0]); | 794 GetSingleURLFilter(download_urls_[0]); |
778 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( | 795 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( |
779 url_filter, base::Time(), base::Time::Max()); | 796 url_filter, base::Time(), base::Time::Max()); |
780 EXPECT_EQ(remove_count, 1); | 797 EXPECT_EQ(remove_count, 1); |
781 } | 798 } |
782 | 799 |
783 } // namespace content | 800 } // namespace content |
OLD | NEW |