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

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: Fix code style Created 7 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
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..921f97b359596df0f12b85f9903679edee7ffa65 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/"));
@@ -206,6 +206,9 @@ TEST(ContentSettingsPatternTest, TrimEndingDotFromHost) {
Pattern("www.example.com.").ToString().c_str());
EXPECT_TRUE(Pattern("www.example.com.") == Pattern("www.example.com"));
+
+ EXPECT_TRUE(Pattern(".").IsValid());
+ EXPECT_STREQ(".", Pattern(".").ToString().c_str());
}
TEST(ContentSettingsPatternTest, FromString_WithNoWildcards) {
@@ -443,6 +446,10 @@ 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());
+
+ // Host having multiple ending dots.
+ EXPECT_FALSE(Pattern("www.example.com..").IsValid());
+ EXPECT_STREQ("", Pattern("www.example.com..").ToString().c_str());
}
TEST(ContentSettingsPatternTest, UnequalOperator) {
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698