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 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 base::File file_stream, | 392 base::File file_stream, |
393 scoped_ptr<ByteStreamReader> byte_stream, | 393 scoped_ptr<ByteStreamReader> byte_stream, |
394 const net::BoundNetLog& bound_net_log, | 394 const net::BoundNetLog& bound_net_log, |
395 base::WeakPtr<DownloadDestinationObserver> observer) { | 395 base::WeakPtr<DownloadDestinationObserver> observer) { |
396 return MockCreateFile(save_info, calculate_hash, byte_stream.get()); | 396 return MockCreateFile(save_info, calculate_hash, byte_stream.get()); |
397 } | 397 } |
398 }; | 398 }; |
399 | 399 |
400 class MockBrowserContext : public BrowserContext { | 400 class MockBrowserContext : public BrowserContext { |
401 public: | 401 public: |
402 MockBrowserContext() {} | 402 MockBrowserContext() { |
| 403 content::BrowserContext::Initialize(this, base::FilePath()); |
| 404 } |
403 ~MockBrowserContext() {} | 405 ~MockBrowserContext() {} |
404 | 406 |
405 MOCK_CONST_METHOD0(GetPath, base::FilePath()); | 407 MOCK_CONST_METHOD0(GetPath, base::FilePath()); |
406 MOCK_METHOD1(CreateZoomLevelDelegateMock, | 408 MOCK_METHOD1(CreateZoomLevelDelegateMock, |
407 ZoomLevelDelegate*(const base::FilePath&)); | 409 ZoomLevelDelegate*(const base::FilePath&)); |
408 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); | 410 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); |
409 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); | 411 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); |
410 MOCK_METHOD1(GetRequestContextForRenderProcess, | 412 MOCK_METHOD1(GetRequestContextForRenderProcess, |
411 net::URLRequestContextGetter*(int renderer_child_id)); | 413 net::URLRequestContextGetter*(int renderer_child_id)); |
412 MOCK_METHOD0(GetMediaRequestContext, | 414 MOCK_METHOD0(GetMediaRequestContext, |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); | 734 EXPECT_CALL(GetMockDownloadItem(1), Remove()).Times(0); |
733 | 735 |
734 base::Callback<bool(const GURL&)> url_filter = | 736 base::Callback<bool(const GURL&)> url_filter = |
735 GetSingleURLFilter(download_urls_[0]); | 737 GetSingleURLFilter(download_urls_[0]); |
736 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( | 738 int remove_count = download_manager_->RemoveDownloadsByURLAndTime( |
737 url_filter, base::Time(), base::Time::Max()); | 739 url_filter, base::Time(), base::Time::Max()); |
738 EXPECT_EQ(remove_count, 1); | 740 EXPECT_EQ(remove_count, 1); |
739 } | 741 } |
740 | 742 |
741 } // namespace content | 743 } // namespace content |
OLD | NEW |