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

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

Issue 10826089: Allow chrome://* to always include cookies in secure XHRs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8075666aeb01c001fb3397f18d63630e24dd5617..e8f1640f94729085bf8931c7bce17d63700ef9f3 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -1017,7 +1017,7 @@ TEST_F(HostContentSettingsMapTest, SettingDefaultContentSettingsWhenManaged) {
CONTENT_SETTINGS_TYPE_PLUGINS, NULL));
}
-TEST_F(HostContentSettingsMapTest, ShouldAllowAllContent) {
+TEST_F(HostContentSettingsMapTest, GetContentSetting) {
TestingProfile profile;
HostContentSettingsMap* host_content_settings_map =
profile.GetHostContentSettingsMap();
@@ -1040,6 +1040,37 @@ TEST_F(HostContentSettingsMapTest, ShouldAllowAllContent) {
embedder, host, CONTENT_SETTINGS_TYPE_IMAGES, ""));
}
+TEST_F(HostContentSettingsMapTest, ShouldAllowAllContent) {
+ TestingProfile profile;
+ HostContentSettingsMap* host_content_settings_map =
+ profile.GetHostContentSettingsMap();
+
+ GURL http_host("http://example.com/");
+ GURL https_host("https://example.com/");
+ GURL embedder("chrome://foo");
+ GURL extension("chrome-extension://foo");
+ EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent(
+ http_host, embedder, CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
+ EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent(
+ http_host, embedder, CONTENT_SETTINGS_TYPE_GEOLOCATION));
+ EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent(
+ http_host, embedder, CONTENT_SETTINGS_TYPE_COOKIES));
+ EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent(
+ https_host, embedder, CONTENT_SETTINGS_TYPE_COOKIES));
+ EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent(
+ https_host, embedder, CONTENT_SETTINGS_TYPE_COOKIES));
+ EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent(
+ embedder, http_host, CONTENT_SETTINGS_TYPE_COOKIES));
+ EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent(
+ extension, extension, CONTENT_SETTINGS_TYPE_COOKIES));
+ EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent(
+ extension, extension, CONTENT_SETTINGS_TYPE_PLUGINS));
+ EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent(
+ extension, extension, CONTENT_SETTINGS_TYPE_INTENTS));
+ EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent(
+ extension, http_host, CONTENT_SETTINGS_TYPE_COOKIES));
+}
+
TEST_F(HostContentSettingsMapTest, MigrateClearOnExit) {
TestingProfile profile;
TestingPrefService* prefs = profile.GetTestingPrefService();
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698