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/public/test/test_browser_context.h" | 5 #include "content/public/test/test_browser_context.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/test/null_task_runner.h" | 10 #include "base/test/null_task_runner.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void TestBrowserContext::SetSpecialStoragePolicy( | 59 void TestBrowserContext::SetSpecialStoragePolicy( |
60 storage::SpecialStoragePolicy* policy) { | 60 storage::SpecialStoragePolicy* policy) { |
61 special_storage_policy_ = policy; | 61 special_storage_policy_ = policy; |
62 } | 62 } |
63 | 63 |
64 void TestBrowserContext::SetPermissionManager( | 64 void TestBrowserContext::SetPermissionManager( |
65 std::unique_ptr<PermissionManager> permission_manager) { | 65 std::unique_ptr<PermissionManager> permission_manager) { |
66 permission_manager_ = std::move(permission_manager); | 66 permission_manager_ = std::move(permission_manager); |
67 } | 67 } |
68 | 68 |
| 69 net::URLRequestContextGetter* TestBrowserContext::GetRequestContext() { |
| 70 if (!request_context_.get()) { |
| 71 request_context_ = new TestContextURLRequestContextGetter(); |
| 72 } |
| 73 return request_context_.get(); |
| 74 } |
| 75 |
69 base::FilePath TestBrowserContext::GetPath() const { | 76 base::FilePath TestBrowserContext::GetPath() const { |
70 return browser_context_dir_.path(); | 77 return browser_context_dir_.path(); |
71 } | 78 } |
72 | 79 |
73 std::unique_ptr<ZoomLevelDelegate> TestBrowserContext::CreateZoomLevelDelegate( | 80 std::unique_ptr<ZoomLevelDelegate> TestBrowserContext::CreateZoomLevelDelegate( |
74 const base::FilePath& partition_path) { | 81 const base::FilePath& partition_path) { |
75 return std::unique_ptr<ZoomLevelDelegate>(); | 82 return std::unique_ptr<ZoomLevelDelegate>(); |
76 } | 83 } |
77 | 84 |
78 bool TestBrowserContext::IsOffTheRecord() const { | 85 bool TestBrowserContext::IsOffTheRecord() const { |
79 return false; | 86 return false; |
80 } | 87 } |
81 | 88 |
82 DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { | 89 DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { |
83 return NULL; | 90 return NULL; |
84 } | 91 } |
85 | 92 |
86 net::URLRequestContextGetter* TestBrowserContext::GetRequestContext() { | |
87 if (!request_context_.get()) { | |
88 request_context_ = new TestContextURLRequestContextGetter(); | |
89 } | |
90 return request_context_.get(); | |
91 } | |
92 | |
93 net::URLRequestContextGetter* TestBrowserContext::GetMediaRequestContext() { | 93 net::URLRequestContextGetter* TestBrowserContext::GetMediaRequestContext() { |
94 return NULL; | 94 return NULL; |
95 } | 95 } |
96 | 96 |
97 net::URLRequestContextGetter* | 97 net::URLRequestContextGetter* |
98 TestBrowserContext::GetMediaRequestContextForRenderProcess( | 98 TestBrowserContext::GetMediaRequestContextForRenderProcess( |
99 int renderer_child_id) { | 99 int renderer_child_id) { |
100 return NULL; | 100 return NULL; |
101 } | 101 } |
102 | 102 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 net::URLRequestContextGetter* | 152 net::URLRequestContextGetter* |
153 TestBrowserContext::CreateRequestContextForStoragePartition( | 153 TestBrowserContext::CreateRequestContextForStoragePartition( |
154 const base::FilePath& partition_path, | 154 const base::FilePath& partition_path, |
155 bool in_memory, | 155 bool in_memory, |
156 ProtocolHandlerMap* protocol_handlers, | 156 ProtocolHandlerMap* protocol_handlers, |
157 URLRequestInterceptorScopedVector request_interceptors) { | 157 URLRequestInterceptorScopedVector request_interceptors) { |
158 return nullptr; | 158 return nullptr; |
159 } | 159 } |
160 | 160 |
161 } // namespace content | 161 } // namespace content |
OLD | NEW |