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

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

Issue 1641533006: CSP: Add an experimental 'unsafe-dynamic' source expression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Experiment. Created 4 years, 11 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: 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 d261957d9ed302eabbc4c72a2395018476802fba..73b05a00b459e67217aebf718ee85c6599126f8f 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp
+++ b/third_party/WebKit/Source/core/frame/csp/CSPSourceListTest.cpp
@@ -53,6 +53,15 @@ TEST_F(CSPSourceListTest, BasicMatchingNone)
EXPECT_FALSE(sourceList.matches(KURL(base, "https://example.test/")));
}
+TEST_F(CSPSourceListTest, BasicMatchingUnsafeDynamic)
+{
+ String sources = "'unsafe-dynamic'";
+ CSPSourceList sourceList(csp.get(), "script-src");
+ parseSourceList(sourceList, sources);
+
+ EXPECT_TRUE(sourceList.allowDynamic());
+}
+
TEST_F(CSPSourceListTest, BasicMatchingStar)
{
KURL base;

Powered by Google App Engine
This is Rietveld 408576698