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

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

Issue 1895993003: Add migration code to change existing domain scoped content settings to be origin scoped (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..1e415f40f21f261d5eb1a6acd74cfc5ac6c718f0 100644
--- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc
+++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc
@@ -232,7 +232,7 @@ TEST_F(HostContentSettingsMapTest, Clear) {
#endif
}
-TEST_F(HostContentSettingsMapTest, Patterns) {
+TEST_F(HostContentSettingsMapTest, Origins) {
msramek 2016/04/19 18:51:34 Hmm. This test indeed doesn't test patterns anymor
raymes 2016/04/20 01:53:21 That's a good point. We can still test patterns he
lshang 2016/06/15 06:26:41 Yep, I've changed it back to explicitly use patter
lshang 2016/06/15 06:26:41 As above.
TestingProfile profile;
HostContentSettingsMap* host_content_settings_map =
HostContentSettingsMapFactory::GetForProfile(&profile);
@@ -249,7 +249,7 @@ TEST_F(HostContentSettingsMapTest, Patterns) {
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host1, host1, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
- EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
host2, host2, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
EXPECT_EQ(CONTENT_SETTING_ALLOW,
@@ -271,7 +271,7 @@ TEST_F(HostContentSettingsMapTest, Observer) {
GURL host("http://example.com/");
ContentSettingsPattern primary_pattern =
- ContentSettingsPattern::FromString("[*.]example.com");
+ ContentSettingsPattern::FromString("http://example.com:80");
ContentSettingsPattern secondary_pattern =
ContentSettingsPattern::Wildcard();
EXPECT_CALL(observer,
@@ -544,12 +544,14 @@ TEST_F(HostContentSettingsMapTest, NestedSettings) {
host_content_settings_map->SetDefaultContentSetting(
CONTENT_SETTINGS_TYPE_JAVASCRIPT, CONTENT_SETTING_BLOCK);
- EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ // Cookies and Images only take effect per-origin.
raymes 2016/04/20 01:53:21 Same here, I think since this test explicitly test
lshang 2016/06/15 06:26:41 Done.
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_COOKIES, std::string()));
- EXPECT_EQ(CONTENT_SETTING_BLOCK,
+ EXPECT_EQ(CONTENT_SETTING_ALLOW,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_IMAGES, std::string()));
+ // Default settings affect all sites which have no exceptions.
EXPECT_EQ(CONTENT_SETTING_BLOCK,
host_content_settings_map->GetContentSetting(
host, host, CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string()));
@@ -1053,7 +1055,7 @@ TEST_F(HostContentSettingsMapTest, AddContentSettingsObserver) {
GURL host("http://example.com/");
ContentSettingsPattern pattern =
- ContentSettingsPattern::FromString("[*.]example.com");
+ ContentSettingsPattern::FromString("http://example.com:80");
EXPECT_CALL(mock_observer,
OnContentSettingChanged(pattern,
ContentSettingsPattern::Wildcard(),

Powered by Google App Engine
This is Rietveld 408576698