Lines Matching refs:notifier
100 MockPrefNotifier notifier(&pref_service_);
101 EXPECT_CALL(notifier, FireObservers(kChangedPref)).Times(1);
102 notifier.OnPreferenceChanged(kChangedPref);
106 MockPrefNotifier notifier(&pref_service_);
108 notifier.AddInitObserver(
112 notifier.OnInitializationCompleted(true);
119 MockPrefNotifier notifier(&pref_service_);
120 notifier.AddPrefObserver(pref_name, &obs1_);
121 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs1_));
122 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs1_));
123 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_));
124 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs2_));
130 notifier.AddPrefObserver(pref_name, &obs1_);
131 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs1_));
132 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs1_));
133 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_));
134 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs2_));
138 notifier.AddPrefObserver(pref_name2, &obs1_);
139 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs1_));
140 ASSERT_EQ(1u, notifier.CountObserver(pref_name2, &obs1_));
141 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_));
142 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs2_));
145 notifier.AddPrefObserver(pref_name, &obs2_);
146 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs1_));
147 ASSERT_EQ(1u, notifier.CountObserver(pref_name2, &obs1_));
148 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs2_));
149 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs2_));
153 notifier.RemovePrefObserver(pref_name, &obs1_);
154 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs1_));
155 ASSERT_EQ(1u, notifier.CountObserver(pref_name2, &obs1_));
156 ASSERT_EQ(1u, notifier.CountObserver(pref_name, &obs2_));
157 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs2_));
159 notifier.RemovePrefObserver(pref_name, &obs2_);
160 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs1_));
161 ASSERT_EQ(1u, notifier.CountObserver(pref_name2, &obs1_));
162 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_));
163 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs2_));
165 notifier.RemovePrefObserver(pref_name, &obs1_);
166 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs1_));
167 ASSERT_EQ(1u, notifier.CountObserver(pref_name2, &obs1_));
168 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_));
169 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs2_));
171 notifier.RemovePrefObserver(pref_name2, &obs1_);
172 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs1_));
173 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs1_));
174 ASSERT_EQ(0u, notifier.CountObserver(pref_name, &obs2_));
175 ASSERT_EQ(0u, notifier.CountObserver(pref_name2, &obs2_));
179 TestingPrefNotifierImpl notifier(&pref_service_);
180 notifier.AddPrefObserver(kChangedPref, &obs1_);
181 notifier.AddPrefObserver(kUnchangedPref, &obs1_);
185 notifier.OnPreferenceChanged(kChangedPref);
189 notifier.AddPrefObserver(kChangedPref, &obs2_);
190 notifier.AddPrefObserver(kUnchangedPref, &obs2_);
194 notifier.OnPreferenceChanged(kChangedPref);
199 notifier.RemovePrefObserver(kChangedPref, &obs1_);
203 notifier.OnPreferenceChanged(kChangedPref);
208 notifier.RemovePrefObserver(kUnchangedPref, &obs1_);
212 notifier.OnPreferenceChanged(kChangedPref);
216 notifier.RemovePrefObserver(kChangedPref, &obs2_);
217 notifier.RemovePrefObserver(kUnchangedPref, &obs2_);