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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "content/browser/byte_stream.h" | 18 #include "content/browser/byte_stream.h" |
19 #include "content/browser/download/download_create_info.h" | 19 #include "content/browser/download/download_create_info.h" |
20 #include "content/browser/download/download_file_factory.h" | 20 #include "content/browser/download/download_file_factory.h" |
21 #include "content/browser/download/download_item_factory.h" | 21 #include "content/browser/download/download_item_factory.h" |
22 #include "content/browser/download/download_item_impl.h" | 22 #include "content/browser/download/download_item_impl.h" |
23 #include "content/browser/download/download_item_impl_delegate.h" | 23 #include "content/browser/download/download_item_impl_delegate.h" |
24 #include "content/browser/download/download_manager_impl.h" | 24 #include "content/browser/download/download_manager_impl.h" |
25 #include "content/browser/download/download_request_handle.h" | 25 #include "content/browser/download/download_request_handle.h" |
26 #include "content/browser/download/mock_download_file.h" | 26 #include "content/browser/download/mock_download_file.h" |
27 #include "content/public/browser/browser_context.h" | 27 #include "content/public/browser/browser_context.h" |
| 28 #include "content/public/browser/cookie_store_factory.h" |
28 #include "content/public/browser/download_interrupt_reasons.h" | 29 #include "content/public/browser/download_interrupt_reasons.h" |
29 #include "content/public/browser/download_item.h" | 30 #include "content/public/browser/download_item.h" |
30 #include "content/public/browser/download_manager_delegate.h" | 31 #include "content/public/browser/download_manager_delegate.h" |
31 #include "content/public/test/mock_download_item.h" | 32 #include "content/public/test/mock_download_item.h" |
32 #include "content/public/test/test_browser_context.h" | 33 #include "content/public/test/test_browser_context.h" |
33 #include "content/public/test/test_browser_thread.h" | 34 #include "content/public/test/test_browser_thread.h" |
34 #include "net/base/net_log.h" | 35 #include "net/base/net_log.h" |
35 #include "net/base/net_util.h" | 36 #include "net/base/net_util.h" |
36 #include "testing/gmock/include/gmock/gmock.h" | 37 #include "testing/gmock/include/gmock/gmock.h" |
37 #include "testing/gmock_mutant.h" | 38 #include "testing/gmock_mutant.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 381 } |
381 }; | 382 }; |
382 | 383 |
383 class MockBrowserContext : public BrowserContext { | 384 class MockBrowserContext : public BrowserContext { |
384 public: | 385 public: |
385 MockBrowserContext() {} | 386 MockBrowserContext() {} |
386 ~MockBrowserContext() {} | 387 ~MockBrowserContext() {} |
387 | 388 |
388 MOCK_CONST_METHOD0(GetPath, base::FilePath()); | 389 MOCK_CONST_METHOD0(GetPath, base::FilePath()); |
389 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); | 390 MOCK_CONST_METHOD0(IsOffTheRecord, bool()); |
| 391 MOCK_METHOD0(GetCookieStoreConfig, CookieStoreConfig()); |
390 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); | 392 MOCK_METHOD0(GetRequestContext, net::URLRequestContextGetter*()); |
391 MOCK_METHOD1(GetRequestContextForRenderProcess, | 393 MOCK_METHOD1(GetRequestContextForRenderProcess, |
392 net::URLRequestContextGetter*(int renderer_child_id)); | 394 net::URLRequestContextGetter*(int renderer_child_id)); |
393 MOCK_METHOD0(GetMediaRequestContext, | 395 MOCK_METHOD0(GetMediaRequestContext, |
394 net::URLRequestContextGetter*()); | 396 net::URLRequestContextGetter*()); |
395 MOCK_METHOD1(GetMediaRequestContextForRenderProcess, | 397 MOCK_METHOD1(GetMediaRequestContextForRenderProcess, |
396 net::URLRequestContextGetter*(int renderer_child_id)); | 398 net::URLRequestContextGetter*(int renderer_child_id)); |
397 MOCK_METHOD2(GetMediaRequestContextForStoragePartition, | 399 MOCK_METHOD2(GetMediaRequestContextForStoragePartition, |
398 net::URLRequestContextGetter*( | 400 net::URLRequestContextGetter*( |
399 const base::FilePath& partition_path, bool in_memory)); | 401 const base::FilePath& partition_path, bool in_memory)); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 .WillOnce(Return()); | 664 .WillOnce(Return()); |
663 EXPECT_CALL(GetMockDownloadItem(3), Remove()) | 665 EXPECT_CALL(GetMockDownloadItem(3), Remove()) |
664 .Times(0); | 666 .Times(0); |
665 | 667 |
666 download_manager_->RemoveAllDownloads(); | 668 download_manager_->RemoveAllDownloads(); |
667 // Because we're mocking the download item, the Remove call doesn't | 669 // Because we're mocking the download item, the Remove call doesn't |
668 // result in them being removed from the DownloadManager list. | 670 // result in them being removed from the DownloadManager list. |
669 } | 671 } |
670 | 672 |
671 } // namespace content | 673 } // namespace content |
OLD | NEW |