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

Unified Diff: chrome/browser/ui/webui/options/preferences_browsertest.cc

Issue 11362250: Remove PrefObserver usages, batch 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac build. 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
« no previous file with comments | « chrome/browser/ui/webui/options/preferences_browsertest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/preferences_browsertest.cc
diff --git a/chrome/browser/ui/webui/options/preferences_browsertest.cc b/chrome/browser/ui/webui/options/preferences_browsertest.cc
index 5f313476260adef5b8b887de561678a58c7eeb5e..2fe90a97c59a039021061d05b6fd3dcad9d69ef6 100644
--- a/chrome/browser/ui/webui/options/preferences_browsertest.cc
+++ b/chrome/browser/ui/webui/options/preferences_browsertest.cc
@@ -162,9 +162,7 @@ void PreferencesBrowserTest::SetUpOnMainThread() {
}
// Forwards notifications received when pref values change in the backend.
-void PreferencesBrowserTest::OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) {
- ASSERT_EQ(pref_service_, service);
+void PreferencesBrowserTest::OnPreferenceChanged(const std::string& pref_name) {
OnCommit(pref_service_->FindPreference(pref_name.c_str()));
}
@@ -269,14 +267,20 @@ void PreferencesBrowserTest::VerifyObservedPrefs(
}
void PreferencesBrowserTest::ExpectNoCommit(const std::string& name) {
- pref_change_registrar_.Add(name.c_str(), this);
+ pref_change_registrar_.Add(
+ name.c_str(),
+ base::Bind(&PreferencesBrowserTest::OnPreferenceChanged,
+ base::Unretained(this)));
EXPECT_CALL(*this, OnCommit(Property(&PrefService::Preference::name, name)))
.Times(0);
}
void PreferencesBrowserTest::ExpectSetCommit(const std::string& name,
const base::Value* value) {
- pref_change_registrar_.Add(name.c_str(), this);
+ pref_change_registrar_.Add(
+ name.c_str(),
+ base::Bind(&PreferencesBrowserTest::OnPreferenceChanged,
+ base::Unretained(this)));
EXPECT_CALL(*this, OnCommit(AllOf(
Property(&PrefService::Preference::name, name),
Property(&PrefService::Preference::IsUserControlled, true),
@@ -284,7 +288,10 @@ void PreferencesBrowserTest::ExpectSetCommit(const std::string& name,
}
void PreferencesBrowserTest::ExpectClearCommit(const std::string& name) {
- pref_change_registrar_.Add(name.c_str(), this);
+ pref_change_registrar_.Add(
+ name.c_str(),
+ base::Bind(&PreferencesBrowserTest::OnPreferenceChanged,
+ base::Unretained(this)));
EXPECT_CALL(*this, OnCommit(AllOf(
Property(&PrefService::Preference::name, name),
Property(&PrefService::Preference::IsUserControlled, false))));
« no previous file with comments | « chrome/browser/ui/webui/options/preferences_browsertest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698