summaryrefslogtreecommitdiffstats
path: root/chrome/browser/host_zoom_map_unittest.cc
diff options
context:
space:
mode:
authordanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-22 13:47:59 +0000
committerdanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-22 13:47:59 +0000
commit2510323ec78d771c9258fa95d8f98b5d18f3efaa (patch)
tree2bbb6a5c3ebba6adf5f01982c75ba52275aadcc4 /chrome/browser/host_zoom_map_unittest.cc
parent37d5293518a8657af4d79035f7ef2e8c3a8d6b9a (diff)
downloadchromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.zip
chromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.tar.gz
chromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.tar.bz2
Revert 60169 - Use PrefChangeRegistrar everywhere
BUG=54955 TEST=PrefChangeRegistrarTest.* Review URL: http://codereview.chromium.org/3304015 TBR=danno@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60170 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/host_zoom_map_unittest.cc')
-rw-r--r--chrome/browser/host_zoom_map_unittest.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/chrome/browser/host_zoom_map_unittest.cc b/chrome/browser/host_zoom_map_unittest.cc
index 5d206e1..e6b1f72 100644
--- a/chrome/browser/host_zoom_map_unittest.cc
+++ b/chrome/browser/host_zoom_map_unittest.cc
@@ -70,9 +70,7 @@ TEST_F(HostZoomMapTest, Load) {
TEST_F(HostZoomMapTest, SetZoomLevel) {
scoped_refptr<HostZoomMap> map(new HostZoomMap(&profile_));
- PrefChangeRegistrar registrar;
- registrar.Init(prefs_);
- registrar.Add(prefs::kPerHostZoomLevels, &pref_observer_);
+ prefs_->AddPrefObserver(prefs::kPerHostZoomLevels, &pref_observer_);
SetPrefObserverExpectation();
map->SetZoomLevel(url_, kZoomLevel);
EXPECT_EQ(kZoomLevel, map->GetZoomLevel(url_));
@@ -86,19 +84,19 @@ TEST_F(HostZoomMapTest, SetZoomLevel) {
map->SetZoomLevel(url_, 0);
EXPECT_EQ(0, map->GetZoomLevel(url_));
EXPECT_FALSE(dict->HasKey(host_));
+ prefs_->RemovePrefObserver(prefs::kPerHostZoomLevels, &pref_observer_);
}
TEST_F(HostZoomMapTest, ResetToDefaults) {
scoped_refptr<HostZoomMap> map(new HostZoomMap(&profile_));
map->SetZoomLevel(url_, kZoomLevel);
- PrefChangeRegistrar registrar;
- registrar.Init(prefs_);
- registrar.Add(prefs::kPerHostZoomLevels, &pref_observer_);
+ prefs_->AddPrefObserver(prefs::kPerHostZoomLevels, &pref_observer_);
SetPrefObserverExpectation();
map->ResetToDefaults();
EXPECT_EQ(0, map->GetZoomLevel(url_));
EXPECT_EQ(NULL, prefs_->GetDictionary(prefs::kPerHostZoomLevels));
+ prefs_->RemovePrefObserver(prefs::kPerHostZoomLevels, &pref_observer_);
}
TEST_F(HostZoomMapTest, ReloadOnPrefChange) {