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

Side by Side Diff: chrome/browser/chromeos/ownership/owner_settings_service_chromeos_unittest.cc

Issue 790183002: Revert of Call to CrosSettings::Set() is replaced by OwnerSettingsService::Set() in VersionUpda... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <queue> 5 #include <queue>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 management_settings_set_(false) {} 89 management_settings_set_(false) {}
90 90
91 virtual void SetUp() override { 91 virtual void SetUp() override {
92 DeviceSettingsTestBase::SetUp(); 92 DeviceSettingsTestBase::SetUp();
93 provider_.reset(new DeviceSettingsProvider(base::Bind(&OnPrefChanged), 93 provider_.reset(new DeviceSettingsProvider(base::Bind(&OnPrefChanged),
94 &device_settings_service_)); 94 &device_settings_service_));
95 owner_key_util_->SetPrivateKey(device_policy_.GetSigningKey()); 95 owner_key_util_->SetPrivateKey(device_policy_.GetSigningKey());
96 InitOwner(device_policy_.policy_data().username(), true); 96 InitOwner(device_policy_.policy_data().username(), true);
97 FlushDeviceSettings(); 97 FlushDeviceSettings();
98 98
99 service_ = OwnerSettingsServiceChromeOSFactory::GetForBrowserContext( 99 service_ =
100 profile_.get()); 100 OwnerSettingsServiceChromeOSFactory::GetForProfile(profile_.get());
101 ASSERT_TRUE(service_); 101 ASSERT_TRUE(service_);
102 ASSERT_TRUE(service_->IsOwner()); 102 ASSERT_TRUE(service_->IsOwner());
103 103
104 device_policy_.policy_data().set_management_mode( 104 device_policy_.policy_data().set_management_mode(
105 em::PolicyData::LOCAL_OWNER); 105 em::PolicyData::LOCAL_OWNER);
106 device_policy_.Build(); 106 device_policy_.Build();
107 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob()); 107 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob());
108 ReloadDeviceSettings(); 108 ReloadDeviceSettings();
109 } 109 }
110 110
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 : public OwnerSettingsServiceChromeOSTest { 298 : public OwnerSettingsServiceChromeOSTest {
299 public: 299 public:
300 OwnerSettingsServiceChromeOSNoOwnerTest() {} 300 OwnerSettingsServiceChromeOSNoOwnerTest() {}
301 virtual ~OwnerSettingsServiceChromeOSNoOwnerTest() {} 301 virtual ~OwnerSettingsServiceChromeOSNoOwnerTest() {}
302 302
303 virtual void SetUp() override { 303 virtual void SetUp() override {
304 DeviceSettingsTestBase::SetUp(); 304 DeviceSettingsTestBase::SetUp();
305 provider_.reset(new DeviceSettingsProvider(base::Bind(&OnPrefChanged), 305 provider_.reset(new DeviceSettingsProvider(base::Bind(&OnPrefChanged),
306 &device_settings_service_)); 306 &device_settings_service_));
307 FlushDeviceSettings(); 307 FlushDeviceSettings();
308 service_ = OwnerSettingsServiceChromeOSFactory::GetForBrowserContext( 308 service_ =
309 profile_.get()); 309 OwnerSettingsServiceChromeOSFactory::GetForProfile(profile_.get());
310 ASSERT_TRUE(service_); 310 ASSERT_TRUE(service_);
311 ASSERT_FALSE(service_->IsOwner()); 311 ASSERT_FALSE(service_->IsOwner());
312 } 312 }
313 313
314 virtual void TearDown() override { DeviceSettingsTestBase::TearDown(); } 314 virtual void TearDown() override { DeviceSettingsTestBase::TearDown(); }
315 315
316 private: 316 private:
317 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSNoOwnerTest); 317 DISALLOW_COPY_AND_ASSIGN(OwnerSettingsServiceChromeOSNoOwnerTest);
318 }; 318 };
319 319
320 TEST_F(OwnerSettingsServiceChromeOSNoOwnerTest, SingleSetTest) { 320 TEST_F(OwnerSettingsServiceChromeOSNoOwnerTest, SingleSetTest) {
321 ASSERT_FALSE(service_->SetBoolean(kAccountsPrefAllowGuest, false)); 321 ASSERT_FALSE(service_->SetBoolean(kAccountsPrefAllowGuest, false));
322 } 322 }
323 323
324 } // namespace chromeos 324 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698