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

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

Issue 11316163: Remove the last usages of PrefObserver outside of Prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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/prefs/mock_pref_change_callback.cc ('k') | chrome/browser/prefs/pref_observer_mock.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_notifier_impl_unittest.cc
diff --git a/chrome/browser/prefs/pref_notifier_impl_unittest.cc b/chrome/browser/prefs/pref_notifier_impl_unittest.cc
index 4c5211e5758fe1559b378d1409d4f19777d0edea..8460dc7617cccf5e98cd27315ab71fa7c38e2b03 100644
--- a/chrome/browser/prefs/pref_notifier_impl_unittest.cc
+++ b/chrome/browser/prefs/pref_notifier_impl_unittest.cc
@@ -5,8 +5,8 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/prefs/public/pref_observer.h"
+#include "chrome/browser/prefs/mock_pref_change_callback.h"
#include "chrome/browser/prefs/pref_notifier_impl.h"
-#include "chrome/browser/prefs/pref_observer_mock.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/common/chrome_notification_types.h"
@@ -34,7 +34,9 @@ class MockPrefInitObserver {
// OnPreferenceChanged public for tests.
class TestingPrefNotifierImpl : public PrefNotifierImpl {
public:
- TestingPrefNotifierImpl(PrefService* service) : PrefNotifierImpl(service) {}
+ explicit TestingPrefNotifierImpl(PrefService* service)
+ : PrefNotifierImpl(service) {
+ }
// Make public for tests.
using PrefNotifierImpl::OnPreferenceChanged;
@@ -72,6 +74,21 @@ class MockPrefNotifier : public PrefNotifierImpl {
using PrefNotifierImpl::OnInitializationCompleted;
};
+class PrefObserverMock : public PrefObserver {
+ public:
+ PrefObserverMock() {}
+ virtual ~PrefObserverMock() {}
+
+ MOCK_METHOD2(OnPreferenceChanged, void(PrefServiceBase*, const std::string&));
+
+ void Expect(PrefServiceBase* prefs,
+ const std::string& pref_name,
+ const Value* value) {
+ EXPECT_CALL(*this, OnPreferenceChanged(prefs, pref_name))
+ .With(PrefValueMatches(prefs, pref_name, value));
+ }
+};
+
// Test fixture class.
class PrefNotifierTest : public testing::Test {
protected:
« no previous file with comments | « chrome/browser/prefs/mock_pref_change_callback.cc ('k') | chrome/browser/prefs/pref_observer_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698