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.h" | 10 #include "chrome/browser/chromeos/ownership/owner_settings_service.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 device_settings_test_helper_.Flush(); | 245 device_settings_test_helper_.Flush(); |
246 } | 246 } |
247 | 247 |
248 void DeviceSettingsTestBase::ReloadDeviceSettings() { | 248 void DeviceSettingsTestBase::ReloadDeviceSettings() { |
249 device_settings_service_.OwnerKeySet(true); | 249 device_settings_service_.OwnerKeySet(true); |
250 FlushDeviceSettings(); | 250 FlushDeviceSettings(); |
251 } | 251 } |
252 | 252 |
253 void DeviceSettingsTestBase::InitOwner(const std::string& user_id, | 253 void DeviceSettingsTestBase::InitOwner(const std::string& user_id, |
254 bool tpm_is_ready) { | 254 bool tpm_is_ready) { |
255 const User* user = user_manager_->FindUser(user_id); | 255 const user_manager::User* user = user_manager_->FindUser(user_id); |
256 if (!user) { | 256 if (!user) { |
257 user = user_manager_->AddUser(user_id); | 257 user = user_manager_->AddUser(user_id); |
258 profile_->set_profile_name(user_id); | 258 profile_->set_profile_name(user_id); |
259 | 259 |
260 ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, | 260 ProfileHelper::Get()->SetUserToProfileMappingForTesting(user, |
261 profile_.get()); | 261 profile_.get()); |
262 } | 262 } |
263 OwnerSettingsService* service = | 263 OwnerSettingsService* service = |
264 OwnerSettingsServiceFactory::GetForProfile(profile_.get()); | 264 OwnerSettingsServiceFactory::GetForProfile(profile_.get()); |
265 CHECK(service); | 265 CHECK(service); |
266 if (tpm_is_ready) | 266 if (tpm_is_ready) |
267 service->OnTPMTokenReady(); | 267 service->OnTPMTokenReady(); |
268 OwnerSettingsServiceFactory::GetInstance()->SetUsername(user_id); | 268 OwnerSettingsServiceFactory::GetInstance()->SetUsername(user_id); |
269 } | 269 } |
270 | 270 |
271 } // namespace chromeos | 271 } // namespace chromeos |
OLD | NEW |