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

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

Issue 14306004: Put Kiosk App parameters into device settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 8 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_provider_unittest.cc
diff --git a/chrome/browser/chromeos/settings/device_settings_provider_unittest.cc b/chrome/browser/chromeos/settings/device_settings_provider_unittest.cc
index 169d3aa7049dc7686fd6b5ecad66e52dbb63ccf3..ddf9a605c734f31feab38ce78cbfc5d840682ddc 100644
--- a/chrome/browser/chromeos/settings/device_settings_provider_unittest.cc
+++ b/chrome/browser/chromeos/settings/device_settings_provider_unittest.cc
@@ -263,4 +263,27 @@ TEST_F(DeviceSettingsProviderTest, StatsReportingMigration) {
EXPECT_FALSE(bool_value);
}
+TEST_F(DeviceSettingsProviderTest, LegacyDeviceLocalAccounts) {
+ EXPECT_CALL(*this, SettingChanged(_)).Times(AnyNumber());
+ em::DeviceLocalAccountInfoProto* account =
+ device_policy_.payload().mutable_device_local_accounts()->add_account();
+ account->set_id(policy::PolicyBuilder::kFakeUsername);
+ device_policy_.Build();
+ device_settings_test_helper_.set_policy_blob(device_policy_.GetBlob());
+ ReloadDeviceSettings();
+ Mock::VerifyAndClearExpectations(this);
+
+ // On load, the deprecated spec should have been converted to the new format.
+ base::ListValue expected_accounts;
+ scoped_ptr<base::DictionaryValue> entry_dict(new base::DictionaryValue());
+ entry_dict->SetString(kAccountsPrefDeviceLocalAccountsKeyId,
+ policy::PolicyBuilder::kFakeUsername);
+ entry_dict->SetInteger(kAccountsPrefDeviceLocalAccountsKeyType,
+ DEVICE_LOCAL_ACCOUNT_TYPE_PUBLIC_SESSION);
+ expected_accounts.Append(entry_dict.release());
+ const base::Value* actual_accounts =
+ provider_->Get(kAccountsPrefDeviceLocalAccounts);
+ EXPECT_TRUE(base::Value::Equals(&expected_accounts, actual_accounts));
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698