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

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

Issue 10950032: Fix queued writes in DeviceSettingsProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove redundant EXPECT_CALL. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3835748c2bf5d424dfcabf0d4de1dbdb095cf67f..72c697edf1bd7d74fdcafd224845957df94e28e1 100644
--- a/chrome/browser/chromeos/settings/device_settings_provider_unittest.cc
+++ b/chrome/browser/chromeos/settings/device_settings_provider_unittest.cc
@@ -204,6 +204,29 @@ TEST_F(DeviceSettingsProviderTest, SetPrefSucceed) {
EXPECT_TRUE(bool_value);
}
+TEST_F(DeviceSettingsProviderTest, SetPrefTwice) {
+ owner_key_util_->SetPrivateKey(policy_.signing_key());
+ device_settings_service_.SetUsername(policy_.policy_data().username());
+ device_settings_test_helper_.Flush();
+
+ EXPECT_CALL(*this, SettingChanged(_)).Times(AnyNumber());
+
+ base::StringValue value1("beta");
+ provider_->Set(kReleaseChannel, value1);
+ base::StringValue value2("dev");
+ provider_->Set(kReleaseChannel, value2);
+
+ // Let the changes propagate through the system.
+ device_settings_test_helper_.set_policy_blob(std::string());
+ device_settings_test_helper_.Flush();
+
+ // Verify the second change has been applied.
+ const base::Value* saved_value = provider_->Get(kReleaseChannel);
+ EXPECT_TRUE(value2.Equals(saved_value));
+
+ Mock::VerifyAndClearExpectations(this);
+}
+
TEST_F(DeviceSettingsProviderTest, PolicyRetrievalFailedBadSignature) {
owner_key_util_->SetPublicKeyFromPrivateKey(policy_.signing_key());
policy_.policy().set_policy_data_signature("bad signature");
« no previous file with comments | « chrome/browser/chromeos/settings/device_settings_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698