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

Unified Diff: Source/core/frame/csp/CSPSourceTest.cpp

Issue 1362813002: CSP source *.x.y should not match host x.y (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Test fixes Created 5 years, 3 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 | « Source/core/frame/csp/CSPSourceListTest.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/csp/CSPSourceTest.cpp
diff --git a/Source/core/frame/csp/CSPSourceTest.cpp b/Source/core/frame/csp/CSPSourceTest.cpp
index 7bf1c78f0ff6dd2ca1f0d87098a1b4a7f99e59e3..0fbe8172351d56f27842384189f58353cea83f09 100644
--- a/Source/core/frame/csp/CSPSourceTest.cpp
+++ b/Source/core/frame/csp/CSPSourceTest.cpp
@@ -43,12 +43,14 @@ TEST_F(CSPSourceTest, WildcardMatching)
KURL base;
CSPSource source(csp.get(), "http", "example.com", 0, "/", CSPSource::HasWildcard, CSPSource::HasWildcard);
- EXPECT_TRUE(source.matches(KURL(base, "http://example.com:8000/")));
- EXPECT_TRUE(source.matches(KURL(base, "http://example.com:8000/foo")));
- EXPECT_TRUE(source.matches(KURL(base, "http://example.com:9000/foo/")));
EXPECT_TRUE(source.matches(KURL(base, "http://foo.example.com:8000/")));
+ EXPECT_TRUE(source.matches(KURL(base, "http://foo.example.com:8000/foo")));
+ EXPECT_TRUE(source.matches(KURL(base, "http://foo.example.com:9000/foo/")));
EXPECT_TRUE(source.matches(KURL(base, "HTTP://FOO.EXAMPLE.com:8000/foo/BAR")));
+ EXPECT_FALSE(source.matches(KURL(base, "http://example.com:8000/")));
+ EXPECT_FALSE(source.matches(KURL(base, "http://example.com:8000/foo")));
+ EXPECT_FALSE(source.matches(KURL(base, "http://example.com:9000/foo/")));
EXPECT_FALSE(source.matches(KURL(base, "http://example.foo.com:8000/")));
EXPECT_FALSE(source.matches(KURL(base, "https://example.foo.com:8000/")));
EXPECT_FALSE(source.matches(KURL(base, "https://example.com:8000/bar/")));
« no previous file with comments | « Source/core/frame/csp/CSPSourceListTest.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698