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

Unified Diff: chrome/browser/prefs/pref_service_unittest.cc

Issue 3323022: Create a DefaultPrefStore to hold registered application-default preference v... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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
Index: chrome/browser/prefs/pref_service_unittest.cc
===================================================================
--- chrome/browser/prefs/pref_service_unittest.cc (revision 59196)
+++ chrome/browser/prefs/pref_service_unittest.cc (working copy)
@@ -212,6 +212,11 @@
scoped_ptr<Value> default_value(Value::CreateStringValue(default_string));
prefs_.RegisterStringPref(name_, default_string);
prefs_.AddPrefObserver(name_, &observer_);
+ // Changing the controlling store from default to user triggers notification.
+ SetExpectPrefChanged();
+ prefs_.Set(name_, *default_value);
+ Mock::VerifyAndClearExpectations(&observer_);
+
SetExpectNoNotification();
prefs_.Set(name_, *default_value);
Mock::VerifyAndClearExpectations(&observer_);
@@ -228,6 +233,8 @@
prefs_.RegisterDictionaryPref(name_);
prefs_.AddPrefObserver(name_, &observer_);
+ // Dictionary values are special: setting one to NULL is the same as clearing
+ // the user value, allowing the NULL default to take (or keep) control.
SetExpectNoNotification();
prefs_.Set(name_, *null_value_);
Mock::VerifyAndClearExpectations(&observer_);
@@ -260,6 +267,8 @@
prefs_.RegisterListPref(name_);
prefs_.AddPrefObserver(name_, &observer_);
+ // List values are special: setting one to NULL is the same as clearing the
+ // user value, allowing the NULL default to take (or keep) control.
SetExpectNoNotification();
prefs_.Set(name_, *null_value_);
Mock::VerifyAndClearExpectations(&observer_);

Powered by Google App Engine
This is Rietveld 408576698