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/browser/chromeos/settings/device_settings_test_helper.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_test_helper.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/threading/sequenced_worker_pool.h" | 9 #include "base/threading/sequenced_worker_pool.h" |
10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" | 10 #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 Flush(); | 193 Flush(); |
194 } | 194 } |
195 | 195 |
196 ScopedDeviceSettingsTestHelper::~ScopedDeviceSettingsTestHelper() { | 196 ScopedDeviceSettingsTestHelper::~ScopedDeviceSettingsTestHelper() { |
197 Flush(); | 197 Flush(); |
198 DeviceSettingsService::Get()->UnsetSessionManager(); | 198 DeviceSettingsService::Get()->UnsetSessionManager(); |
199 DeviceSettingsService::Shutdown(); | 199 DeviceSettingsService::Shutdown(); |
200 } | 200 } |
201 | 201 |
202 DeviceSettingsTestBase::DeviceSettingsTestBase() | 202 DeviceSettingsTestBase::DeviceSettingsTestBase() |
203 : user_manager_(new FakeChromeUserManager()), | 203 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
| 204 user_manager_(new FakeChromeUserManager()), |
204 user_manager_enabler_(user_manager_), | 205 user_manager_enabler_(user_manager_), |
205 owner_key_util_(new ownership::MockOwnerKeyUtil()) { | 206 owner_key_util_(new ownership::MockOwnerKeyUtil()) { |
206 OwnerSettingsServiceChromeOSFactory::SetDeviceSettingsServiceForTesting( | 207 OwnerSettingsServiceChromeOSFactory::SetDeviceSettingsServiceForTesting( |
207 &device_settings_service_); | 208 &device_settings_service_); |
208 OwnerSettingsServiceChromeOSFactory::GetInstance()->SetOwnerKeyUtilForTesting( | 209 OwnerSettingsServiceChromeOSFactory::GetInstance()->SetOwnerKeyUtilForTesting( |
209 owner_key_util_); | 210 owner_key_util_); |
210 } | 211 } |
211 | 212 |
212 DeviceSettingsTestBase::~DeviceSettingsTestBase() { | 213 DeviceSettingsTestBase::~DeviceSettingsTestBase() { |
213 base::RunLoop().RunUntilIdle(); | 214 base::RunLoop().RunUntilIdle(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 const_cast<user_manager::User*>(user)); | 259 const_cast<user_manager::User*>(user)); |
259 } | 260 } |
260 OwnerSettingsServiceChromeOS* service = | 261 OwnerSettingsServiceChromeOS* service = |
261 OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile_.get()); | 262 OwnerSettingsServiceChromeOSFactory::GetForBrowserContext(profile_.get()); |
262 CHECK(service); | 263 CHECK(service); |
263 if (tpm_is_ready) | 264 if (tpm_is_ready) |
264 service->OnTPMTokenReady(true /* token is enabled */); | 265 service->OnTPMTokenReady(true /* token is enabled */); |
265 } | 266 } |
266 | 267 |
267 } // namespace chromeos | 268 } // namespace chromeos |
OLD | NEW |