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

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

Issue 1257093002: Remove the migration code from content_settings::PrefProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lock testing function. Created 5 years, 4 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 8b09a1ebbe8033167c7e2c8f502f6be989fcddc4..54ee848abf530731a0393e7c60b4290944e04c56 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -355,7 +355,7 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) {
// Make a copy of the default pref value so we can reset it later.
scoped_ptr<base::Value> default_value(prefs->FindPreference(
- prefs::kContentSettingsPatternPairs)->GetValue()->DeepCopy());
+ prefs::kContentSettingsImagesPatternPairs)->GetValue()->DeepCopy());
ContentSettingsPattern pattern =
ContentSettingsPattern::FromString("[*.]example.com");
@@ -377,16 +377,16 @@ TEST_F(HostContentSettingsMapTest, ObserveExceptionPref) {
// Make a copy of the pref's new value so we can reset it later.
scoped_ptr<base::Value> new_value(prefs->FindPreference(
- prefs::kContentSettingsPatternPairs)->GetValue()->DeepCopy());
+ prefs::kContentSettingsImagesPatternPairs)->GetValue()->DeepCopy());
// Clearing the backing pref should also clear the internal cache.
- prefs->Set(prefs::kContentSettingsPatternPairs, *default_value);
+ prefs->Set(prefs::kContentSettingsImagesPatternPairs, *default_value);
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::kContentSettingsPatternPairs, *new_value);
+ prefs->Set(prefs::kContentSettingsImagesPatternPairs, *new_value);
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
@@ -673,12 +673,12 @@ TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeOnly) {
// Set utf-8 data.
{
DictionaryPrefUpdate update(
- prefs, prefs::kContentSettingsPatternPairs);
+ prefs, prefs::kContentSettingsPluginsPatternPairs);
base::DictionaryValue* all_settings_dictionary = update.Get();
ASSERT_TRUE(NULL != all_settings_dictionary);
base::DictionaryValue* dummy_payload = new base::DictionaryValue;
- dummy_payload->SetInteger("images", CONTENT_SETTING_ALLOW);
+ dummy_payload->SetInteger("setting", CONTENT_SETTING_ALLOW);
all_settings_dictionary->SetWithoutPathExpansion("[*.]\xC4\x87ira.com,*",
dummy_payload);
}
@@ -686,7 +686,7 @@ TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeOnly) {
profile.GetHostContentSettingsMap();
const base::DictionaryValue* all_settings_dictionary =
- prefs->GetDictionary(prefs::kContentSettingsImagesPatternPairs);
+ prefs->GetDictionary(prefs::kContentSettingsPluginsPatternPairs);
const base::DictionaryValue* result = NULL;
EXPECT_FALSE(all_settings_dictionary->GetDictionaryWithoutPathExpansion(
"[*.]\xC4\x87ira.com,*", &result));
@@ -700,21 +700,21 @@ TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeAndPunycode) {
TestingProfile profile;
scoped_ptr<base::Value> value(base::JSONReader::DeprecatedRead(
- "{\"[*.]\\xC4\\x87ira.com,*\":{\"images\":1}}"));
- profile.GetPrefs()->Set(prefs::kContentSettingsPatternPairs, *value);
+ "{\"[*.]\\xC4\\x87ira.com,*\":{\"setting\":1}}"));
+ profile.GetPrefs()->Set(prefs::kContentSettingsCookiesPatternPairs, *value);
// Set punycode equivalent, with different setting.
scoped_ptr<base::Value> puny_value(base::JSONReader::DeprecatedRead(
- "{\"[*.]xn--ira-ppa.com,*\":{\"images\":2}}"));
+ "{\"[*.]xn--ira-ppa.com,*\":{\"setting\":2}}"));
profile.GetPrefs()->Set(
- prefs::kContentSettingsPatternPairs, *puny_value);
+ prefs::kContentSettingsCookiesPatternPairs, *puny_value);
// Initialize the content map.
profile.GetHostContentSettingsMap();
const base::DictionaryValue& content_setting_prefs =
*profile.GetPrefs()->GetDictionary(
- prefs::kContentSettingsImagesPatternPairs);
+ prefs::kContentSettingsCookiesPatternPairs);
std::string prefs_as_json;
base::JSONWriter::Write(content_setting_prefs, &prefs_as_json);
EXPECT_STREQ("{\"[*.]xn--ira-ppa.com,*\":{\"setting\":2}}",

Powered by Google App Engine
This is Rietveld 408576698