| 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/file_path.h" | 7 #include "base/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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 namespace content { | 42 namespace content { |
| 43 | 43 |
| 44 TestBrowserContext::TestBrowserContext() { | 44 TestBrowserContext::TestBrowserContext() { |
| 45 EXPECT_TRUE(browser_context_dir_.CreateUniqueTempDir()); | 45 EXPECT_TRUE(browser_context_dir_.CreateUniqueTempDir()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 TestBrowserContext::~TestBrowserContext() { | 48 TestBrowserContext::~TestBrowserContext() { |
| 49 } | 49 } |
| 50 | 50 |
| 51 FilePath TestBrowserContext::TakePath() { | 51 base::FilePath TestBrowserContext::TakePath() { |
| 52 return browser_context_dir_.Take(); | 52 return browser_context_dir_.Take(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void TestBrowserContext::SetSpecialStoragePolicy( | 55 void TestBrowserContext::SetSpecialStoragePolicy( |
| 56 quota::SpecialStoragePolicy* policy) { | 56 quota::SpecialStoragePolicy* policy) { |
| 57 special_storage_policy_ = policy; | 57 special_storage_policy_ = policy; |
| 58 } | 58 } |
| 59 | 59 |
| 60 FilePath TestBrowserContext::GetPath() { | 60 base::FilePath TestBrowserContext::GetPath() { |
| 61 return browser_context_dir_.path(); | 61 return browser_context_dir_.path(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool TestBrowserContext::IsOffTheRecord() const { | 64 bool TestBrowserContext::IsOffTheRecord() const { |
| 65 return false; | 65 return false; |
| 66 } | 66 } |
| 67 | 67 |
| 68 DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { | 68 DownloadManagerDelegate* TestBrowserContext::GetDownloadManagerDelegate() { |
| 69 return NULL; | 69 return NULL; |
| 70 } | 70 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 87 } | 87 } |
| 88 | 88 |
| 89 net::URLRequestContextGetter* | 89 net::URLRequestContextGetter* |
| 90 TestBrowserContext::GetMediaRequestContextForRenderProcess( | 90 TestBrowserContext::GetMediaRequestContextForRenderProcess( |
| 91 int renderer_child_id) { | 91 int renderer_child_id) { |
| 92 return NULL; | 92 return NULL; |
| 93 } | 93 } |
| 94 | 94 |
| 95 net::URLRequestContextGetter* | 95 net::URLRequestContextGetter* |
| 96 TestBrowserContext::GetMediaRequestContextForStoragePartition( | 96 TestBrowserContext::GetMediaRequestContextForStoragePartition( |
| 97 const FilePath& partition_path, | 97 const base::FilePath& partition_path, |
| 98 bool in_memory) { | 98 bool in_memory) { |
| 99 return NULL; | 99 return NULL; |
| 100 } | 100 } |
| 101 | 101 |
| 102 ResourceContext* TestBrowserContext::GetResourceContext() { | 102 ResourceContext* TestBrowserContext::GetResourceContext() { |
| 103 if (!resource_context_.get()) | 103 if (!resource_context_.get()) |
| 104 resource_context_.reset(new MockResourceContext()); | 104 resource_context_.reset(new MockResourceContext()); |
| 105 return resource_context_.get(); | 105 return resource_context_.get(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 GeolocationPermissionContext* | 108 GeolocationPermissionContext* |
| 109 TestBrowserContext::GetGeolocationPermissionContext() { | 109 TestBrowserContext::GetGeolocationPermissionContext() { |
| 110 return NULL; | 110 return NULL; |
| 111 } | 111 } |
| 112 | 112 |
| 113 SpeechRecognitionPreferences* | 113 SpeechRecognitionPreferences* |
| 114 TestBrowserContext::GetSpeechRecognitionPreferences() { | 114 TestBrowserContext::GetSpeechRecognitionPreferences() { |
| 115 return NULL; | 115 return NULL; |
| 116 } | 116 } |
| 117 | 117 |
| 118 quota::SpecialStoragePolicy* TestBrowserContext::GetSpecialStoragePolicy() { | 118 quota::SpecialStoragePolicy* TestBrowserContext::GetSpecialStoragePolicy() { |
| 119 return special_storage_policy_.get(); | 119 return special_storage_policy_.get(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace content | 122 } // namespace content |
| OLD | NEW |