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

Unified Diff: chrome/browser/content_settings/host_content_settings_map_unittest.cc

Issue 1252973002: Remove the migration code from content_settings::DefaultProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 5 months 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
Index: chrome/browser/content_settings/host_content_settings_map_unittest.cc
diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
index 7bb058c39b20b03427d196c5bd07d11dba7dedba..8b09a1ebbe8033167c7e2c8f502f6be989fcddc4 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -325,11 +325,6 @@ TEST_F(HostContentSettingsMapTest, ObserveDefaultPref) {
profile.GetHostContentSettingsMap();
PrefService* prefs = profile.GetPrefs();
-
- // Make a copy of the default pref value so we can reset it later.
- scoped_ptr<base::Value> default_value(prefs->FindPreference(
- prefs::kDefaultContentSettings)->GetValue()->DeepCopy());
-
GURL host("http://example.com");
host_content_settings_map->SetDefaultContentSetting(
@@ -338,18 +333,14 @@ TEST_F(HostContentSettingsMapTest, ObserveDefaultPref) {
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
- // Make a copy of the pref's new value so we can reset it later.
- scoped_ptr<base::Value> new_value(prefs->FindPreference(
- prefs::kDefaultContentSettings)->GetValue()->DeepCopy());
-
// Clearing the backing pref should also clear the internal cache.
- prefs->Set(prefs::kDefaultContentSettings, *default_value);
+ prefs->ClearPref(prefs::kDefaultImagesSetting);
EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
// Reseting the pref to its previous value should update the cache.
- prefs->Set(prefs::kDefaultContentSettings, *new_value);
+ prefs->SetInteger(prefs::kDefaultImagesSetting, CONTENT_SETTING_BLOCK);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));

Powered by Google App Engine
This is Rietveld 408576698