Index: chrome/browser/profiles/off_the_record_profile_impl_unittest.cc |
diff --git a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc |
index 62a79789d5d1a92b4eabfcac8c81f8430e932849..f8d1f740189a7317d42078e00a44acf3cf0b2585 100644 |
--- a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc |
+++ b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc |
@@ -9,6 +9,7 @@ |
#include "base/prefs/scoped_user_pref_update.h" |
#include "base/run_loop.h" |
#include "chrome/browser/prefs/browser_prefs.h" |
+#include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/test/base/browser_with_test_window_test.h" |
#include "chrome/test/base/testing_browser_process.h" |
@@ -27,11 +28,13 @@ namespace { |
class TestingProfileWithHostZoomMap : public TestingProfile { |
public: |
TestingProfileWithHostZoomMap() { |
- zoom_subscription_ = |
- HostZoomMap::GetDefaultForBrowserContext(this) |
- ->AddZoomLevelChangedCallback( |
- base::Bind(&TestingProfileWithHostZoomMap::OnZoomLevelChanged, |
- base::Unretained(this))); |
+ HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this); |
+ zoom_subscription_ = host_zoom_map->AddZoomLevelChangedCallback( |
+ base::Bind(&TestingProfileWithHostZoomMap::OnZoomLevelChanged, |
+ base::Unretained(this))); |
+ zoom_level_prefs_.reset( |
+ new chrome::ChromeZoomLevelPrefs(GetPrefs(), GetPath())); |
+ zoom_level_prefs_->InitPrefsAndCopyToHostZoomMap(GetPath(), host_zoom_map); |
} |
virtual ~TestingProfileWithHostZoomMap() {} |
@@ -50,7 +53,10 @@ class TestingProfileWithHostZoomMap : public TestingProfile { |
HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this); |
double level = change.zoom_level; |
- DictionaryPrefUpdate update(prefs_.get(), prefs::kPerHostZoomLevels); |
+ std::string per_host_zoom_levels(prefs::kPerHostZoomLevels); |
+ per_host_zoom_levels.append(".0"); |
+ DictionaryPrefUpdate update(GetPrefs(), |
+ prefs::kPerHostZoomLevels); |
base::DictionaryValue* host_zoom_dictionary = update.Get(); |
if (content::ZoomValuesEqual(level, host_zoom_map->GetDefaultZoomLevel())) { |
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, NULL); |
@@ -61,6 +67,7 @@ class TestingProfileWithHostZoomMap : public TestingProfile { |
} |
scoped_ptr<HostZoomMap::Subscription> zoom_subscription_; |
+ scoped_ptr<chrome::ChromeZoomLevelPrefs> zoom_level_prefs_; |
DISALLOW_COPY_AND_ASSIGN(TestingProfileWithHostZoomMap); |
}; |