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

Unified Diff: chrome/browser/chromeos/settings/device_settings_test_helper.cc

Issue 985093002: Fix up Owner settings on first load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: based off mattias' patch that injects CrosSettings for testing Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/settings/device_settings_test_helper.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_test_helper.cc b/chrome/browser/chromeos/settings/device_settings_test_helper.cc
index abc8cafa8e5dd59ed5b2ef791bf6147b0470092f..4157b4c68ddad73329ded5784fa2fdd14211a528 100644
--- a/chrome/browser/chromeos/settings/device_settings_test_helper.cc
+++ b/chrome/browser/chromeos/settings/device_settings_test_helper.cc
@@ -203,11 +203,14 @@ DeviceSettingsTestBase::DeviceSettingsTestBase()
: thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
user_manager_(new FakeChromeUserManager()),
user_manager_enabler_(user_manager_),
- owner_key_util_(new ownership::MockOwnerKeyUtil()) {
+ owner_key_util_(new ownership::MockOwnerKeyUtil()),
+ cros_settings_(&device_settings_service_) {
OwnerSettingsServiceChromeOSFactory::SetDeviceSettingsServiceForTesting(
&device_settings_service_);
OwnerSettingsServiceChromeOSFactory::GetInstance()->SetOwnerKeyUtilForTesting(
owner_key_util_);
+ OwnerSettingsServiceChromeOSFactory::SetCrosSettingsForTesting(
+ &cros_settings_);
}
DeviceSettingsTestBase::~DeviceSettingsTestBase() {
@@ -231,6 +234,7 @@ void DeviceSettingsTestBase::SetUp() {
}
void DeviceSettingsTestBase::TearDown() {
+ OwnerSettingsServiceChromeOSFactory::SetCrosSettingsForTesting(nullptr);
OwnerSettingsServiceChromeOSFactory::SetDeviceSettingsServiceForTesting(NULL);
FlushDeviceSettings();
device_settings_service_.UnsetSessionManager();

Powered by Google App Engine
This is Rietveld 408576698