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 "chrome/test/base/testing_browser_process.h" | 5 #include "chrome/test/base/testing_browser_process.h" |
6 | 6 |
7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "base/time/default_clock.h" | 8 #include "base/time/default_clock.h" |
9 #include "base/time/default_tick_clock.h" | 9 #include "base/time/default_tick_clock.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 policy::BrowserPolicyConnector* | 146 policy::BrowserPolicyConnector* |
147 TestingBrowserProcess::browser_policy_connector() { | 147 TestingBrowserProcess::browser_policy_connector() { |
148 if (!browser_policy_connector_) { | 148 if (!browser_policy_connector_) { |
149 EXPECT_FALSE(created_browser_policy_connector_); | 149 EXPECT_FALSE(created_browser_policy_connector_); |
150 created_browser_policy_connector_ = true; | 150 created_browser_policy_connector_ = true; |
151 browser_policy_connector_ = platform_part_->CreateBrowserPolicyConnector(); | 151 browser_policy_connector_ = platform_part_->CreateBrowserPolicyConnector(); |
152 | 152 |
153 // Note: creating the ChromeBrowserPolicyConnector invokes BrowserThread:: | 153 // Note: creating the ChromeBrowserPolicyConnector invokes BrowserThread:: |
154 // GetMessageLoopProxyForThread(), which initializes a base::LazyInstance of | 154 // GetTaskRunnerForThread(), which initializes a base::LazyInstance of |
155 // BrowserThreadTaskRunners. However, the threads that these task runners | 155 // BrowserThreadTaskRunners. However, the threads that these task runners |
156 // would run tasks on are *also* created lazily and might not exist yet. | 156 // would run tasks on are *also* created lazily and might not exist yet. |
157 // Creating them requires a MessageLoop, which a test can optionally create | 157 // Creating them requires a MessageLoop, which a test can optionally create |
158 // and manage itself, so don't do it here. | 158 // and manage itself, so don't do it here. |
159 } | 159 } |
160 return browser_policy_connector_.get(); | 160 return browser_policy_connector_.get(); |
161 } | 161 } |
162 | 162 |
163 policy::PolicyService* TestingBrowserProcess::policy_service() { | 163 policy::PolicyService* TestingBrowserProcess::policy_service() { |
164 return browser_policy_connector()->GetPolicyService(); | 164 return browser_policy_connector()->GetPolicyService(); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 448 |
449 /////////////////////////////////////////////////////////////////////////////// | 449 /////////////////////////////////////////////////////////////////////////////// |
450 | 450 |
451 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { | 451 TestingBrowserProcessInitializer::TestingBrowserProcessInitializer() { |
452 TestingBrowserProcess::CreateInstance(); | 452 TestingBrowserProcess::CreateInstance(); |
453 } | 453 } |
454 | 454 |
455 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { | 455 TestingBrowserProcessInitializer::~TestingBrowserProcessInitializer() { |
456 TestingBrowserProcess::DeleteInstance(); | 456 TestingBrowserProcess::DeleteInstance(); |
457 } | 457 } |
OLD | NEW |