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

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

Issue 27635002: Content settings for <audio> and <video>. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fix. Created 6 years, 6 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 84b2b2a2e00603ef8141bf857e24afec43e68318..be85de73b057b1ae5a9daf778f245bd960c9c69d 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -486,6 +486,37 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
host_content_settings_map->GetContentSetting(
host_ending_with_dot,
host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_MEDIA,
+ std::string()));
+ host_content_settings_map->SetContentSetting(
+ pattern,
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_MEDIA,
+ std::string(),
+ CONTENT_SETTING_DEFAULT);
+ EXPECT_EQ(
+ CONTENT_SETTING_ALLOW,
+ host_content_settings_map->GetContentSetting(host_ending_with_dot,
+ host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_MEDIA,
+ std::string()));
+ host_content_settings_map->SetContentSetting(
+ pattern,
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_MEDIA,
+ std::string(),
+ CONTENT_SETTING_BLOCK);
+ EXPECT_EQ(
+ CONTENT_SETTING_BLOCK,
+ host_content_settings_map->GetContentSetting(host_ending_with_dot,
+ host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_MEDIA,
+ std::string()));
+
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
+ host_content_settings_map->GetContentSetting(
+ host_ending_with_dot,
+ host_ending_with_dot,
CONTENT_SETTINGS_TYPE_PLUGINS,
std::string()));
host_content_settings_map->SetContentSetting(
@@ -557,6 +588,8 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
ContentSettingsPattern::FromString("[*.]b.example.com");
ContentSettingsPattern pattern3 =
ContentSettingsPattern::FromString("a.b.example.com");
+ ContentSettingsPattern pattern4 =
+ ContentSettingsPattern::FromString("[*.]c.a.b.example.com");
host_content_settings_map->SetContentSetting(
pattern1,
@@ -581,6 +614,15 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
host_content_settings_map->SetDefaultContentSetting(
CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK);
+ host_content_settings_map->SetDefaultContentSetting(
+ CONTENT_SETTINGS_TYPE_MEDIA, CONTENT_SETTING_BLOCK);
+ host_content_settings_map->SetContentSetting(
+ pattern4,
+ ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_MEDIA,
+ std::string(),
+ CONTENT_SETTING_ALLOW);
+
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
@@ -592,6 +634,9 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
+ host, host, CONTENT_SETTINGS_TYPE_MEDIA, std::string()));
+ EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_PLUGINS, std::string()));
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(

Powered by Google App Engine
This is Rietveld 408576698