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

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

Issue 11368098: Draft change to use base::Closure instead of PrefObserver in PrefChangeRegistrar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 8 years, 1 month 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
diff --git a/chrome/browser/prefs/pref_service_unittest.cc b/chrome/browser/prefs/pref_service_unittest.cc
index 1286f9f76bbafc49286b3371af63e0e6a2c143e3..e46389768f2d9f026cbd4bb9e83dc09bfdc2574b 100644
--- a/chrome/browser/prefs/pref_service_unittest.cc
+++ b/chrome/browser/prefs/pref_service_unittest.cc
@@ -108,6 +108,9 @@ TEST(PrefServiceTest, Observers) {
registrar.Init(&prefs);
registrar.Add(pref_name, &obs);
+ PrefChangeRegistrar registrar_two;
+ registrar_two.Init(&prefs);
+
// This should fire the checks in PrefObserverMock::Observe.
obs.Expect(&prefs, pref_name, &expected_new_pref_value);
prefs.SetString(pref_name, new_pref_value);
@@ -119,7 +122,7 @@ TEST(PrefServiceTest, Observers) {
PrefObserverMock obs2;
obs.Expect(&prefs, pref_name, &expected_new_pref_value2);
obs2.Expect(&prefs, pref_name, &expected_new_pref_value2);
- registrar.Add(pref_name, &obs2);
+ registrar_two.Add(pref_name, &obs2);
// This should fire the checks in obs and obs2.
prefs.SetString(pref_name, new_pref_value2);
Mock::VerifyAndClearExpectations(&obs);
@@ -136,7 +139,7 @@ TEST(PrefServiceTest, Observers) {
Mock::VerifyAndClearExpectations(&obs2);
// Make sure obs2 still works after removing obs.
- registrar.Remove(pref_name, &obs);
+ registrar.Remove(pref_name);
EXPECT_CALL(obs, OnPreferenceChanged(_, _)).Times(0);
obs2.Expect(&prefs, pref_name, &expected_new_pref_value);
// This should only fire the observer in obs2.
« no previous file with comments | « chrome/browser/extensions/extension_prefs_unittest.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698