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

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

Issue 14885008: Actually deprecate DeviceLocalAccountInfoProto.id (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 7 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_provider.h" 5 #include "chrome/browser/chromeos/settings/device_settings_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 ASSERT_TRUE(saved_value); 260 ASSERT_TRUE(saved_value);
261 bool bool_value; 261 bool bool_value;
262 EXPECT_TRUE(saved_value->GetAsBoolean(&bool_value)); 262 EXPECT_TRUE(saved_value->GetAsBoolean(&bool_value));
263 EXPECT_FALSE(bool_value); 263 EXPECT_FALSE(bool_value);
264 } 264 }
265 265
266 TEST_F(DeviceSettingsProviderTest, LegacyDeviceLocalAccounts) { 266 TEST_F(DeviceSettingsProviderTest, LegacyDeviceLocalAccounts) {
267 EXPECT_CALL(*this, SettingChanged(_)).Times(AnyNumber()); 267 EXPECT_CALL(*this, SettingChanged(_)).Times(AnyNumber());
268 em::DeviceLocalAccountInfoProto* account = 268 em::DeviceLocalAccountInfoProto* account =
269 device_policy_.payload().mutable_device_local_accounts()->add_account(); 269 device_policy_.payload().mutable_device_local_accounts()->add_account();
270 account->set_id(policy::PolicyBuilder::kFakeUsername); 270 account->set_deprecated_public_session_id(
271 policy::PolicyBuilder::kFakeUsername);
271 device_policy_.Build(); 272 device_policy_.Build();
272 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob()); 273 device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob());
273 ReloadDeviceSettings(); 274 ReloadDeviceSettings();
274 Mock::VerifyAndClearExpectations(this); 275 Mock::VerifyAndClearExpectations(this);
275 276
276 // On load, the deprecated spec should have been converted to the new format. 277 // On load, the deprecated spec should have been converted to the new format.
277 base::ListValue expected_accounts; 278 base::ListValue expected_accounts;
278 scoped_ptr<base::DictionaryValue> entry_dict(new base::DictionaryValue()); 279 scoped_ptr<base::DictionaryValue> entry_dict(new base::DictionaryValue());
279 entry_dict->SetString(kAccountsPrefDeviceLocalAccountsKeyId, 280 entry_dict->SetString(kAccountsPrefDeviceLocalAccountsKeyId,
280 policy::PolicyBuilder::kFakeUsername); 281 policy::PolicyBuilder::kFakeUsername);
281 entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType, 282 entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType,
282 DEVICE_LOCAL_ACCOUNT_TYPE_PUBLIC_SESSION); 283 DEVICE_LOCAL_ACCOUNT_TYPE_PUBLIC_SESSION);
283 expected_accounts.Append(entry_dict.release()); 284 expected_accounts.Append(entry_dict.release());
284 const base::Value* actual_accounts = 285 const base::Value* actual_accounts =
285 provider_->Get(kAccountsPrefDeviceLocalAccounts); 286 provider_->Get(kAccountsPrefDeviceLocalAccounts);
286 EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts)); 287 EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts));
287 } 288 }
288 289
289 } // namespace chromeos 290 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698