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

Unified Diff: chrome/common/content_settings_pattern_unittest.cc

Issue 9808101: Revert 128753 - Add full support for filesystem URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/content_settings_pattern_unittest.cc
===================================================================
--- chrome/common/content_settings_pattern_unittest.cc (revision 128756)
+++ chrome/common/content_settings_pattern_unittest.cc (working copy)
@@ -73,7 +73,6 @@
pattern = ContentSettingsPattern::FromURL(GURL("https://www.google.com:443"));
EXPECT_TRUE(pattern.Matches(GURL("https://www.google.com")));
- EXPECT_TRUE(pattern.Matches(GURL("https://foo.www.google.com")));
EXPECT_TRUE(pattern.Matches(GURL("https://www.google.com:443")));
EXPECT_FALSE(pattern.Matches(GURL("https://www.google.com:444")));
EXPECT_FALSE(pattern.Matches(GURL("http://www.google.com:443")));
@@ -90,49 +89,6 @@
EXPECT_EQ("file:///foo/bar.html", pattern.ToString());
}
-TEST(ContentSettingsPatternTest, FilesystemUrls) {
- ContentSettingsPattern pattern =
- ContentSettingsPattern::FromURL(GURL("http://www.google.com"));
- EXPECT_TRUE(pattern.Matches(
- GURL("filesystem:http://www.google.com/temporary/")));
- EXPECT_TRUE(pattern.Matches(
- GURL("filesystem:http://foo.www.google.com/temporary/")));
- EXPECT_TRUE(pattern.Matches(
- GURL("filesystem:http://www.google.com:80/temporary/")));
- EXPECT_TRUE(pattern.Matches(
- GURL("filesystem:http://www.google.com:81/temporary/")));
-
- pattern = ContentSettingsPattern::FromURL(GURL("https://www.google.com"));
- EXPECT_TRUE(pattern.Matches(
- GURL("filesystem:https://www.google.com/temporary/")));
- EXPECT_TRUE(pattern.Matches(
- GURL("filesystem:https://www.google.com:443/temporary/")));
- EXPECT_TRUE(pattern.Matches(
- GURL("filesystem:https://foo.www.google.com/temporary/")));
- EXPECT_FALSE(pattern.Matches(
- GURL("filesystem:https://www.google.com:81/temporary/")));
-
- // A pattern from a filesystem URLs is equivalent to a pattern from the inner
- // URL of the filesystem URL.
- ContentSettingsPattern pattern2 = ContentSettingsPattern::FromURL(
- GURL("filesystem:https://www.google.com/temporary/"));
- EXPECT_EQ(ContentSettingsPattern::IDENTITY, pattern.Compare(pattern2));
-
- EXPECT_STREQ("https://[*.]www.google.com:443", pattern2.ToString().c_str());
-
- pattern =
- ContentSettingsPattern::FromURL(
- GURL("filesystem:file:///temporary/foo/bar"));
- EXPECT_TRUE(pattern.Matches(GURL("filesystem:file:///temporary/")));
- EXPECT_TRUE(pattern.Matches(GURL("filesystem:file:///temporary/test.txt")));
- EXPECT_TRUE(pattern.Matches(GURL("file:///temporary")));
- EXPECT_FALSE(pattern.Matches(GURL("file://foo/bar")));
- pattern2 =
- ContentSettingsPattern::FromURL(
- GURL("filesystem:file:///persistent/foo2/bar2"));
- EXPECT_EQ(ContentSettingsPattern::IDENTITY, pattern.Compare(pattern2));
-}
-
TEST(ContentSettingsPatternTest, FromURLNoWildcard) {
// If no port is specifed GURLs always use the default port for the schemes
// HTTP and HTTPS. Hence a GURL always carries a port specification either
@@ -158,21 +114,8 @@
EXPECT_TRUE(pattern.Matches(GURL("https://www.example.com")));
EXPECT_FALSE(pattern.Matches(GURL("http://foo.www.example.com")));
- // Pattern for filesystem URLs
- pattern =
- ContentSettingsPattern::FromURLNoWildcard(
- GURL("filesystem:http://www.google.com/temporary/"));
- EXPECT_TRUE(pattern.IsValid());
- EXPECT_TRUE(pattern.Matches(GURL("http://www.google.com")));
- EXPECT_FALSE(pattern.Matches(GURL("http://foo.www.google.com")));
- EXPECT_TRUE(pattern.Matches(
- GURL("filesystem:http://www.google.com/persistent/")));
- EXPECT_FALSE(pattern.Matches(
- GURL("filesystem:https://www.google.com/persistent/")));
- EXPECT_FALSE(pattern.Matches(
- GURL("filesystem:https://www.google.com:81/temporary/")));
- EXPECT_FALSE(pattern.Matches(
- GURL("filesystem:https://foo.www.google.com/temporary/")));
+ pattern = ContentSettingsPattern::FromURLNoWildcard(
+ GURL("https://www.example.com"));
}
TEST(ContentSettingsPatternTest, Wildcard) {
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698