Chromium Code Reviews| 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..55b56ff69679220a8bb7eca8e0108f5cd71ebfd9 100644 |
| --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc |
| +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc |
| @@ -364,7 +364,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"); |
| @@ -386,16 +386,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())); |
| @@ -682,12 +682,12 @@ TEST_F(HostContentSettingsMapTest, CanonicalizeExceptionsUnicodeOnly) { |
| // Set utf-8 data. |
| { |
| DictionaryPrefUpdate update( |
| - prefs, prefs::kContentSettingsPatternPairs); |
| + prefs, prefs::kContentSettingsPluginsPatternPairs); |
|
raymes
2015/07/28 01:09:14
Who did this change to plugins from images? Is it
msramek
2015/07/28 09:44:58
There were a lot of tests about prefs::kContentSet
|
| 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); |
|
raymes
2015/07/28 01:09:14
in this case is "setting" the plugin name?
msramek
2015/07/28 09:44:58
No. The format for each of the per-type prefs is:
|
| all_settings_dictionary->SetWithoutPathExpansion("[*.]\xC4\x87ira.com,*", |
| dummy_payload); |
| } |
| @@ -695,7 +695,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)); |
| @@ -709,21 +709,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); |
|
raymes
2015/07/28 01:09:14
Who did this change to cookies from images?
msramek
2015/07/28 09:44:58
As above. This must work with any content type. I'
|
| std::string prefs_as_json; |
| base::JSONWriter::Write(content_setting_prefs, &prefs_as_json); |
| EXPECT_STREQ("{\"[*.]xn--ira-ppa.com,*\":{\"setting\":2}}", |