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

Unified Diff: chrome/common/content_settings_pattern_unittest.cc

Issue 13251012: Fix b180514: Some exception entries cannot be deleted from a setting panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring Created 7 years, 9 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/common/content_settings_pattern_unittest.cc
diff --git a/chrome/common/content_settings_pattern_unittest.cc b/chrome/common/content_settings_pattern_unittest.cc
index bd793382e87cc3a6c8019962622f52605084be16..bd30679247bd4890c331c94600335004f79383ce 100644
--- a/chrome/common/content_settings_pattern_unittest.cc
+++ b/chrome/common/content_settings_pattern_unittest.cc
@@ -158,7 +158,7 @@ TEST(ContentSettingsPatternTest, FromURLNoWildcard) {
EXPECT_TRUE(pattern.Matches(GURL("https://www.example.com")));
EXPECT_FALSE(pattern.Matches(GURL("http://foo.www.example.com")));
- // Pattern for filesystem URLs
+ // Pattern for filesystem URLs
pattern =
ContentSettingsPattern::FromURLNoWildcard(
GURL("filesystem:http://www.google.com/temporary/"));
@@ -443,6 +443,15 @@ TEST(ContentSettingsPatternTest, InvalidPatterns) {
EXPECT_STREQ("", Pattern("file://").ToString().c_str());
EXPECT_FALSE(Pattern("file:///foo/bar.html:8080").IsValid());
EXPECT_STREQ("", Pattern("file:///foo/bar.html:8080").ToString().c_str());
+
+ EXPECT_FALSE(Pattern(".").IsValid());
+ EXPECT_STREQ("", Pattern(".").ToString().c_str());
+
+ // Host having consecutive dots.
+ EXPECT_FALSE(Pattern("www.example.com..").IsValid());
+ EXPECT_STREQ("", Pattern("www.example.com..").ToString().c_str());
+ EXPECT_FALSE(Pattern("www..example.com").IsValid());
+ EXPECT_STREQ("", Pattern("www..example.com").ToString().c_str());
}
TEST(ContentSettingsPatternTest, UnequalOperator) {

Powered by Google App Engine
This is Rietveld 408576698