| 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 4573d3d95e49b64b4a43fbdf751c69ff77f3f5ba..1ffe60f775bcb759c80ad3ace2fc39219d4a9d5e 100644
|
| --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
|
| +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
|
| @@ -301,12 +301,16 @@ TEST_F(HostContentSettingsMapTest, Patterns) {
|
| GURL host1("http://example.com/");
|
| GURL host2("http://www.example.com/");
|
| GURL host3("http://example.org/");
|
| + ContentSettingsPattern pattern1 =
|
| + ContentSettingsPattern::FromString("[*.]example.com");
|
| + ContentSettingsPattern pattern2 =
|
| + ContentSettingsPattern::FromString("example.org");
|
| EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| host_content_settings_map->GetContentSetting(
|
| host1, host1, CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
|
| - host_content_settings_map->SetContentSettingDefaultScope(
|
| - host1, GURL(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(),
|
| - CONTENT_SETTING_BLOCK);
|
| + host_content_settings_map->SetContentSettingCustomScope(
|
| + pattern1, ContentSettingsPattern::Wildcard(),
|
| + CONTENT_SETTINGS_TYPE_COOKIES, std::string(), CONTENT_SETTING_BLOCK);
|
| EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| host_content_settings_map->GetContentSetting(
|
| host1, host1, CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
|
| @@ -316,9 +320,9 @@ TEST_F(HostContentSettingsMapTest, Patterns) {
|
| EXPECT_EQ(CONTENT_SETTING_ALLOW,
|
| host_content_settings_map->GetContentSetting(
|
| host3, host3, CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
|
| - host_content_settings_map->SetContentSettingDefaultScope(
|
| - host3, GURL(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(),
|
| - CONTENT_SETTING_BLOCK);
|
| + host_content_settings_map->SetContentSettingCustomScope(
|
| + pattern2, ContentSettingsPattern::Wildcard(),
|
| + CONTENT_SETTINGS_TYPE_COOKIES, std::string(), CONTENT_SETTING_BLOCK);
|
| EXPECT_EQ(CONTENT_SETTING_BLOCK,
|
| host_content_settings_map->GetContentSetting(
|
| host3, host3, CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
|
| @@ -577,19 +581,24 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
|
| HostContentSettingsMapFactory::GetForProfile(&profile);
|
|
|
| GURL host("http://a.b.example.com/");
|
| - GURL host1("http://example.com/");
|
| - GURL host2("http://b.example.com/");
|
| + ContentSettingsPattern pattern1 =
|
| + ContentSettingsPattern::FromString("[*.]example.com");
|
| + ContentSettingsPattern pattern2 =
|
| + ContentSettingsPattern::FromString("[*.]b.example.com");
|
| + ContentSettingsPattern pattern3 =
|
| + ContentSettingsPattern::FromString("a.b.example.com");
|
|
|
| - host_content_settings_map->SetContentSettingDefaultScope(
|
| - host1, GURL(), CONTENT_SETTINGS_TYPE_POPUPS, std::string(),
|
| - CONTENT_SETTING_BLOCK);
|
| + host_content_settings_map->SetContentSettingCustomScope(
|
| + pattern1, ContentSettingsPattern::Wildcard(),
|
| + CONTENT_SETTINGS_TYPE_POPUPS, std::string(), CONTENT_SETTING_BLOCK);
|
|
|
| - host_content_settings_map->SetContentSettingDefaultScope(
|
| - host2, GURL(), CONTENT_SETTINGS_TYPE_COOKIES, std::string(),
|
| - CONTENT_SETTING_BLOCK);
|
| + host_content_settings_map->SetContentSettingCustomScope(
|
| + pattern2, ContentSettingsPattern::Wildcard(),
|
| + CONTENT_SETTINGS_TYPE_COOKIES, std::string(), CONTENT_SETTING_BLOCK);
|
|
|
| - host_content_settings_map->SetContentSettingDefaultScope(
|
| - host, GURL(), CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, std::string(),
|
| + host_content_settings_map->SetContentSettingCustomScope(
|
| + pattern3, ContentSettingsPattern::Wildcard(),
|
| + CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, std::string(),
|
| CONTENT_SETTING_BLOCK);
|
| host_content_settings_map->SetDefaultContentSetting(
|
| CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK);
|
|
|