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 "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/test/null_task_runner.h" | 8 #include "base/test/null_task_runner.h" |
9 #include "content/public/test/mock_resource_context.h" | 9 #include "content/public/test/mock_resource_context.h" |
10 #include "net/url_request/url_request_context.h" | 10 #include "net/url_request/url_request_context.h" |
11 #include "net/url_request/url_request_context_getter.h" | 11 #include "net/url_request/url_request_context_getter.h" |
12 #include "net/url_request/url_request_test_util.h" | 12 #include "net/url_request/url_request_test_util.h" |
13 #include "storage/browser/quota/special_storage_policy.h" | 13 #include "storage/browser/quota/special_storage_policy.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 class TestContextURLRequestContextGetter : public net::URLRequestContextGetter { | 18 class TestContextURLRequestContextGetter : public net::URLRequestContextGetter { |
19 public: | 19 public: |
20 TestContextURLRequestContextGetter() | 20 TestContextURLRequestContextGetter() |
21 : null_task_runner_(new base::NullTaskRunner) { | 21 : null_task_runner_(new base::NullTaskRunner) { |
22 } | 22 } |
23 | 23 |
24 virtual net::URLRequestContext* GetURLRequestContext() override { | 24 net::URLRequestContext* GetURLRequestContext() override { return &context_; } |
25 return &context_; | |
26 } | |
27 | 25 |
28 virtual scoped_refptr<base::SingleThreadTaskRunner> | 26 scoped_refptr<base::SingleThreadTaskRunner> GetNetworkTaskRunner() |
29 GetNetworkTaskRunner() const override { | 27 const override { |
30 return null_task_runner_; | 28 return null_task_runner_; |
31 } | 29 } |
32 | 30 |
33 private: | 31 private: |
34 virtual ~TestContextURLRequestContextGetter() {} | 32 ~TestContextURLRequestContextGetter() override {} |
35 | 33 |
36 net::TestURLRequestContext context_; | 34 net::TestURLRequestContext context_; |
37 scoped_refptr<base::SingleThreadTaskRunner> null_task_runner_; | 35 scoped_refptr<base::SingleThreadTaskRunner> null_task_runner_; |
38 }; | 36 }; |
39 | 37 |
40 } // namespace | 38 } // namespace |
41 | 39 |
42 namespace content { | 40 namespace content { |
43 | 41 |
44 TestBrowserContext::TestBrowserContext() { | 42 TestBrowserContext::TestBrowserContext() { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 113 |
116 PushMessagingService* TestBrowserContext::GetPushMessagingService() { | 114 PushMessagingService* TestBrowserContext::GetPushMessagingService() { |
117 return NULL; | 115 return NULL; |
118 } | 116 } |
119 | 117 |
120 SSLHostStateDelegate* TestBrowserContext::GetSSLHostStateDelegate() { | 118 SSLHostStateDelegate* TestBrowserContext::GetSSLHostStateDelegate() { |
121 return NULL; | 119 return NULL; |
122 } | 120 } |
123 | 121 |
124 } // namespace content | 122 } // namespace content |
OLD | NEW |