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 27 matching lines...) Expand all Loading... |
38 net::TestURLRequestContext context_; | 38 net::TestURLRequestContext context_; |
39 scoped_refptr<base::SingleThreadTaskRunner> null_task_runner_; | 39 scoped_refptr<base::SingleThreadTaskRunner> null_task_runner_; |
40 }; | 40 }; |
41 | 41 |
42 } // namespace | 42 } // namespace |
43 | 43 |
44 namespace content { | 44 namespace content { |
45 | 45 |
46 TestBrowserContext::TestBrowserContext() { | 46 TestBrowserContext::TestBrowserContext() { |
47 EXPECT_TRUE(browser_context_dir_.CreateUniqueTempDir()); | 47 EXPECT_TRUE(browser_context_dir_.CreateUniqueTempDir()); |
| 48 BrowserContext::Initialize(this, browser_context_dir_.path()); |
48 } | 49 } |
49 | 50 |
50 TestBrowserContext::~TestBrowserContext() { | 51 TestBrowserContext::~TestBrowserContext() { |
51 } | 52 } |
52 | 53 |
53 base::FilePath TestBrowserContext::TakePath() { | 54 base::FilePath TestBrowserContext::TakePath() { |
54 return browser_context_dir_.Take(); | 55 return browser_context_dir_.Take(); |
55 } | 56 } |
56 | 57 |
57 void TestBrowserContext::SetSpecialStoragePolicy( | 58 void TestBrowserContext::SetSpecialStoragePolicy( |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 139 } |
139 | 140 |
140 BackgroundSyncController* TestBrowserContext::GetBackgroundSyncController() { | 141 BackgroundSyncController* TestBrowserContext::GetBackgroundSyncController() { |
141 if (!background_sync_controller_) | 142 if (!background_sync_controller_) |
142 background_sync_controller_.reset(new MockBackgroundSyncController()); | 143 background_sync_controller_.reset(new MockBackgroundSyncController()); |
143 | 144 |
144 return background_sync_controller_.get(); | 145 return background_sync_controller_.get(); |
145 } | 146 } |
146 | 147 |
147 } // namespace content | 148 } // namespace content |
OLD | NEW |