| Index: chrome/browser/prefs/scoped_user_pref_update_unittest.cc
|
| diff --git a/chrome/browser/prefs/scoped_user_pref_update_unittest.cc b/chrome/browser/prefs/scoped_user_pref_update_unittest.cc
|
| index f5e6927bd0b2c7260f160df1beb6d952d8784b21..c06d5ef945524403cc360d37bf140e744fde746d 100644
|
| --- a/chrome/browser/prefs/scoped_user_pref_update_unittest.cc
|
| +++ b/chrome/browser/prefs/scoped_user_pref_update_unittest.cc
|
| @@ -3,7 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/prefs/public/pref_change_registrar.h"
|
| -#include "chrome/browser/prefs/pref_observer_mock.h"
|
| +#include "chrome/browser/prefs/mock_pref_change_callback.h"
|
| #include "chrome/browser/prefs/scoped_user_pref_update.h"
|
| #include "chrome/test/base/testing_pref_service.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| @@ -14,13 +14,14 @@ using testing::Mock;
|
|
|
| class ScopedUserPrefUpdateTest : public testing::Test {
|
| public:
|
| + ScopedUserPrefUpdateTest() : observer_(&prefs_) {}
|
| ~ScopedUserPrefUpdateTest() {}
|
|
|
| protected:
|
| virtual void SetUp() {
|
| prefs_.RegisterDictionaryPref(kPref, PrefService::UNSYNCABLE_PREF);
|
| registrar_.Init(&prefs_);
|
| - registrar_.Add(kPref, &observer_);
|
| + registrar_.Add(kPref, observer_.GetCallback());
|
| }
|
|
|
| static const char kPref[];
|
| @@ -28,7 +29,7 @@ class ScopedUserPrefUpdateTest : public testing::Test {
|
| static const char kValue[];
|
|
|
| TestingPrefService prefs_;
|
| - PrefObserverMock observer_;
|
| + MockPrefChangeCallback observer_;
|
| PrefChangeRegistrar registrar_;
|
| };
|
|
|
| @@ -42,7 +43,7 @@ TEST_F(ScopedUserPrefUpdateTest, RegularUse) {
|
| expected_dictionary.SetString(kKey, kValue);
|
|
|
| {
|
| - EXPECT_CALL(observer_, OnPreferenceChanged(_, _)).Times(0);
|
| + EXPECT_CALL(observer_, OnPreferenceChanged(_)).Times(0);
|
| DictionaryPrefUpdate update(&prefs_, kPref);
|
| DictionaryValue* value = update.Get();
|
| ASSERT_TRUE(value);
|
| @@ -58,7 +59,7 @@ TEST_F(ScopedUserPrefUpdateTest, RegularUse) {
|
| EXPECT_TRUE(expected_dictionary.Equals(current_value));
|
|
|
| // Now we are leaving the scope of the update so we should be notified.
|
| - observer_.Expect(&prefs_, kPref, &expected_dictionary);
|
| + observer_.Expect(kPref, &expected_dictionary);
|
| }
|
| Mock::VerifyAndClearExpectations(&observer_);
|
|
|
| @@ -69,7 +70,7 @@ TEST_F(ScopedUserPrefUpdateTest, RegularUse) {
|
|
|
| TEST_F(ScopedUserPrefUpdateTest, NeverTouchAnything) {
|
| const DictionaryValue* old_value = prefs_.GetDictionary(kPref);
|
| - EXPECT_CALL(observer_, OnPreferenceChanged(_, _)).Times(0);
|
| + EXPECT_CALL(observer_, OnPreferenceChanged(_)).Times(0);
|
| {
|
| DictionaryPrefUpdate update(&prefs_, kPref);
|
| }
|
|
|