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

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

Issue 1906533002: Add 'autoplay' content settings and expose it to Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 b890f952115b1943981eac74753a6f702f02d848..e8ad6280e0a7a8477880bee79f041d72c60182d2 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -168,6 +168,13 @@ TEST_F(HostContentSettingsMapTest, IndividualSettings) {
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()));
+ host_content_settings_map->SetContentSettingDefaultScope(
+ host, GURL(), CONTENT_SETTINGS_TYPE_AUTOPLAY, std::string(),
+ CONTENT_SETTING_BLOCK);
+ EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ host_content_settings_map->GetContentSetting(
+ host, host, CONTENT_SETTINGS_TYPE_AUTOPLAY, std::string()));
+
// Check returning all hosts for a setting.
GURL host2("http://example.org/");
host_content_settings_map->SetContentSettingDefaultScope(
@@ -519,6 +526,25 @@ TEST_F(HostContentSettingsMapTest, HostTrimEndingDotCheck) {
host_content_settings_map->GetContentSetting(
host_ending_with_dot, host_ending_with_dot,
CONTENT_SETTINGS_TYPE_KEYGEN, std::string()));
+
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
+ host_content_settings_map->GetContentSetting(
+ host_ending_with_dot, host_ending_with_dot,
+ CONTENT_SETTINGS_TYPE_AUTOPLAY, std::string()));
+ host_content_settings_map->SetContentSettingDefaultScope(
+ host_ending_with_dot, GURL(), CONTENT_SETTINGS_TYPE_AUTOPLAY,
+ 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_AUTOPLAY, std::string()));
+ host_content_settings_map->SetContentSettingDefaultScope(
+ host_ending_with_dot, GURL(), CONTENT_SETTINGS_TYPE_AUTOPLAY,
+ 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_AUTOPLAY, std::string()));
}
TEST_F(HostContentSettingsMapTest, NestedSettings) {
@@ -575,6 +601,9 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_KEYGEN, std::string()));
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
+ host_content_settings_map->GetContentSetting(
+ host, host, CONTENT_SETTINGS_TYPE_AUTOPLAY, std::string()));
}
TEST_F(HostContentSettingsMapTest, OffTheRecord) {

Powered by Google App Engine
This is Rietveld 408576698