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

Unified Diff: third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp

Issue 1455973003: CSP: Source expressions can no longer lock sites into insecurity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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: third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp b/third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp
index 106e8e72f16939961020c1bffd149182cce45d3b..90d38a39b4b1e7068126878a4e5398a488374255 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp
@@ -146,12 +146,16 @@ TEST_F(CSPSourceListTest, WildcardMatching)
EXPECT_TRUE(sourceList.matches(KURL(base, "https://foo.example2.com/bar/")));
EXPECT_TRUE(sourceList.matches(KURL(base, "http://foo.test/")));
EXPECT_TRUE(sourceList.matches(KURL(base, "http://foo.bar.test/")));
+ EXPECT_TRUE(sourceList.matches(KURL(base, "https://example1.com/foo/")));
+ EXPECT_TRUE(sourceList.matches(KURL(base, "https://example1.com:8000/foo/")));
+ EXPECT_TRUE(sourceList.matches(KURL(base, "https://example1.com:9000/foo/")));
+ EXPECT_TRUE(sourceList.matches(KURL(base, "https://foo.test/")));
+ EXPECT_TRUE(sourceList.matches(KURL(base, "https://foo.bar.test/")));
EXPECT_FALSE(sourceList.matches(KURL(base, "https://example1.com:8000/foo")));
EXPECT_FALSE(sourceList.matches(KURL(base, "https://example2.com:8000/bar")));
EXPECT_FALSE(sourceList.matches(KURL(base, "https://foo.example2.com:8000/bar")));
EXPECT_FALSE(sourceList.matches(KURL(base, "https://example2.foo.com/bar")));
- EXPECT_FALSE(sourceList.matches(KURL(base, "https://foo.test/")));
EXPECT_FALSE(sourceList.matches(KURL(base, "http://foo.test.bar/")));
EXPECT_FALSE(sourceList.matches(KURL(base, "https://example2.com/bar/")));
EXPECT_FALSE(sourceList.matches(KURL(base, "http://test/")));
@@ -168,9 +172,10 @@ TEST_F(CSPSourceListTest, RedirectMatching)
EXPECT_TRUE(sourceList.matches(KURL(base, "http://example1.com/bar/"), ContentSecurityPolicy::DidRedirect));
EXPECT_TRUE(sourceList.matches(KURL(base, "http://example2.com/bar/"), ContentSecurityPolicy::DidRedirect));
EXPECT_TRUE(sourceList.matches(KURL(base, "http://example2.com/foo/"), ContentSecurityPolicy::DidRedirect));
+ EXPECT_TRUE(sourceList.matches(KURL(base, "https://example1.com/foo/"), ContentSecurityPolicy::DidRedirect));
+ EXPECT_TRUE(sourceList.matches(KURL(base, "https://example1.com/bar/"), ContentSecurityPolicy::DidRedirect));
EXPECT_FALSE(sourceList.matches(KURL(base, "http://example3.com/foo/"), ContentSecurityPolicy::DidRedirect));
- EXPECT_FALSE(sourceList.matches(KURL(base, "https://example1.com/foo/"), ContentSecurityPolicy::DidRedirect));
}
} // namespace
« no previous file with comments | « third_party/WebKit/Source/core/frame/csp/CSPSource.cpp ('k') | third_party/WebKit/Source/core/frame/csp/CSPSourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698