Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: chrome/browser/chromeos/settings/device_settings_test_helper.cc

Issue 494093002: OwnerKeyUtil is moved to components/ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed GYP file. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h" 11 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h"
12 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" 12 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
13 #include "chrome/browser/chromeos/profiles/profile_helper.h" 13 #include "chrome/browser/chromeos/profiles/profile_helper.h"
14 #include "chrome/browser/chromeos/settings/device_settings_service.h" 14 #include "chrome/browser/chromeos/settings/device_settings_service.h"
15 #include "chrome/browser/chromeos/settings/mock_owner_key_util.h"
16 #include "chrome/test/base/testing_browser_process.h" 15 #include "chrome/test/base/testing_browser_process.h"
17 #include "chrome/test/base/testing_profile.h" 16 #include "chrome/test/base/testing_profile.h"
18 #include "chromeos/dbus/dbus_thread_manager.h" 17 #include "chromeos/dbus/dbus_thread_manager.h"
18 #include "components/ownership/mock_owner_key_util.h"
19 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
20 20
21 namespace chromeos { 21 namespace chromeos {
22 22
23 DeviceSettingsTestHelper::DeviceSettingsTestHelper() {} 23 DeviceSettingsTestHelper::DeviceSettingsTestHelper() {}
24 24
25 DeviceSettingsTestHelper::~DeviceSettingsTestHelper() {} 25 DeviceSettingsTestHelper::~DeviceSettingsTestHelper() {}
26 26
27 void DeviceSettingsTestHelper::FlushLoops() { 27 void DeviceSettingsTestHelper::FlushLoops() {
28 // DeviceSettingsService may trigger operations that hop back and forth 28 // DeviceSettingsService may trigger operations that hop back and forth
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 void DeviceSettingsTestHelper::GetServerBackedStateKeys( 184 void DeviceSettingsTestHelper::GetServerBackedStateKeys(
185 const StateKeysCallback& callback) {} 185 const StateKeysCallback& callback) {}
186 186
187 DeviceSettingsTestHelper::PolicyState::PolicyState() 187 DeviceSettingsTestHelper::PolicyState::PolicyState()
188 : store_result_(true) {} 188 : store_result_(true) {}
189 189
190 DeviceSettingsTestHelper::PolicyState::~PolicyState() {} 190 DeviceSettingsTestHelper::PolicyState::~PolicyState() {}
191 191
192 ScopedDeviceSettingsTestHelper::ScopedDeviceSettingsTestHelper() { 192 ScopedDeviceSettingsTestHelper::ScopedDeviceSettingsTestHelper() {
193 DeviceSettingsService::Initialize(); 193 DeviceSettingsService::Initialize();
194 DeviceSettingsService::Get()->SetSessionManager(this, new MockOwnerKeyUtil()); 194 DeviceSettingsService::Get()->SetSessionManager(
195 this, new ownership::MockOwnerKeyUtil());
195 DeviceSettingsService::Get()->Load(); 196 DeviceSettingsService::Get()->Load();
196 Flush(); 197 Flush();
197 } 198 }
198 199
199 ScopedDeviceSettingsTestHelper::~ScopedDeviceSettingsTestHelper() { 200 ScopedDeviceSettingsTestHelper::~ScopedDeviceSettingsTestHelper() {
200 Flush(); 201 Flush();
201 DeviceSettingsService::Get()->UnsetSessionManager(); 202 DeviceSettingsService::Get()->UnsetSessionManager();
202 DeviceSettingsService::Shutdown(); 203 DeviceSettingsService::Shutdown();
203 } 204 }
204 205
205 DeviceSettingsTestBase::DeviceSettingsTestBase() 206 DeviceSettingsTestBase::DeviceSettingsTestBase()
206 : user_manager_(new FakeUserManager()), 207 : user_manager_(new FakeUserManager()),
207 user_manager_enabler_(user_manager_), 208 user_manager_enabler_(user_manager_),
208 owner_key_util_(new MockOwnerKeyUtil()) { 209 owner_key_util_(new ownership::MockOwnerKeyUtil()) {
209 } 210 }
210 211
211 DeviceSettingsTestBase::~DeviceSettingsTestBase() { 212 DeviceSettingsTestBase::~DeviceSettingsTestBase() {
212 base::RunLoop().RunUntilIdle(); 213 base::RunLoop().RunUntilIdle();
213 } 214 }
214 215
215 void DeviceSettingsTestBase::SetUp() { 216 void DeviceSettingsTestBase::SetUp() {
216 // Initialize DBusThreadManager with a stub implementation. 217 // Initialize DBusThreadManager with a stub implementation.
217 dbus_setter_ = chromeos::DBusThreadManager::GetSetterForTesting(); 218 dbus_setter_ = chromeos::DBusThreadManager::GetSetterForTesting();
218 219
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 profile_.get()); 260 profile_.get());
260 } 261 }
261 OwnerSettingsService* service = 262 OwnerSettingsService* service =
262 OwnerSettingsServiceFactory::GetForProfile(profile_.get()); 263 OwnerSettingsServiceFactory::GetForProfile(profile_.get());
263 CHECK(service); 264 CHECK(service);
264 if (tpm_is_ready) 265 if (tpm_is_ready)
265 service->OnTPMTokenReady(); 266 service->OnTPMTokenReady();
266 } 267 }
267 268
268 } // namespace chromeos 269 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_test_helper.h ('k') | chrome/browser/chromeos/settings/mock_owner_key_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698