Bug 1302667 - CSP: Add Parser test for 'worker-src'. r=dveditz,mckinley
authorChristoph Kerschbaumer <ckerschb@christophkerschbaumer.com>
Mon, 30 Oct 2017 18:45:50 +0100
changeset 389218 2219116fd832b77a24f10f5f0a44a5a2cc09a90f
parent 389217 bbb4d009726349b17ef5864a6bc0aeb60509ab4f
child 389219 8397d379f6a9ba7f2cf837c607324c0b7611a075
push id54380
push userarchaeopteryx@coole-files.de
push dateMon, 30 Oct 2017 22:59:37 +0000
treeherderautoland@4853ca9ebe91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdveditz, mckinley
bugs1302667
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1302667 - CSP: Add Parser test for 'worker-src'. r=dveditz,mckinley
dom/security/test/gtest/TestCSPParser.cpp
--- a/dom/security/test/gtest/TestCSPParser.cpp
+++ b/dom/security/test/gtest/TestCSPParser.cpp
@@ -214,16 +214,20 @@ TEST(CSPParser, Directives)
     { "require-sri-for script style",
       "require-sri-for script style"},
     { "script-src 'nonce-foo' 'unsafe-inline' ",
       "script-src 'nonce-foo' 'unsafe-inline'" },
     { "script-src 'nonce-foo' 'strict-dynamic' 'unsafe-inline' https:  ",
       "script-src 'nonce-foo' 'strict-dynamic' 'unsafe-inline' https:" },
     { "default-src 'sha256-siVR8' 'strict-dynamic' 'unsafe-inline' https:  ",
       "default-src 'sha256-siVR8' 'unsafe-inline' https:" },
+    { "worker-src https://example.com",
+      "worker-src https://example.com" },
+    { "worker-src http://worker.com; frame-src http://frame.com; child-src http://child.com",
+      "worker-src http://worker.com; frame-src http://frame.com; child-src http://child.com" },
   };
 
   uint32_t policyCount = sizeof(policies) / sizeof(PolicyTest);
   ASSERT_TRUE(NS_SUCCEEDED(runTestSuite(policies, policyCount, 1)));
 }
 
 // ============================= TestKeywords ========================