OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Embedded Enforcement: Subsumption Algorithm - 'strict-dynamic' keyword.</
title> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <script src="support/testharness-helper.sub.js"></script> |
| 8 </head> |
| 9 <body> |
| 10 <script> |
| 11 var tests = [ |
| 12 { "name": "'strict-dynamic' is ineffective for `style-src`.", |
| 13 "required_csp": "style-src http://example1.com/foo/ 'self'", |
| 14 "returned_csp_1": "style-src 'strict-dynamic' http://example1.com/foo/ba
r.html", |
| 15 "expected": IframeLoad.EXPECT_LOAD }, |
| 16 { "name": "'strict-dynamic' is ineffective for `img-src`.", |
| 17 "required_csp": "img-src http://example1.com/foo/ 'self'", |
| 18 "returned_csp_1": "img-src 'strict-dynamic' http://example1.com/foo/bar.
html", |
| 19 "expected": IframeLoad.EXPECT_LOAD }, |
| 20 { "name": "'strict-dynamic' is ineffective for `frame-src`.", |
| 21 "required_csp": "frame-src http://example1.com/foo/ 'self'", |
| 22 "returned_csp_1": "frame-src 'strict-dynamic' http://example1.com/foo/ba
r.html", |
| 23 "expected": IframeLoad.EXPECT_LOAD }, |
| 24 { "name": "'strict-dynamic' is ineffective for `child-src`.", |
| 25 "required_csp": "child-src http://example1.com/foo/ 'self'", |
| 26 "returned_csp_1": "child-src 'strict-dynamic' http://example1.com/foo/ba
r.html", |
| 27 "expected": IframeLoad.EXPECT_LOAD }, |
| 28 { "name": "'strict-dynamic' is effective only for `script-src`.", |
| 29 "required_csp": "script-src http://example1.com/foo/ 'self'", |
| 30 "returned_csp_1": "script-src 'strict-dynamic' http://example1.com/foo/b
ar.html", |
| 31 "expected": IframeLoad.EXPECT_BLOCK }, |
| 32 { "name": "'strict-dynamic' is proper handled for finding effective policy
.", |
| 33 "required_csp": "script-src http://example1.com/foo/ 'self'", |
| 34 "returned_csp_1": "script-src 'strict-dynamic' http://example1.com/foo/b
ar.html", |
| 35 "returned_csp_2": "script-src 'strict-dynamic' 'nonce-abc'", |
| 36 "expected": IframeLoad.EXPECT_BLOCK }, |
| 37 { "name": "'strict-dynamic' makes host source expressions ineffective.", |
| 38 "required_csp": "script-src 'strict-dynamic' 'nonce-abc'", |
| 39 "returned_csp_1": "script-src http://example.com 'strict-dynamic' 'nonce
-abc'", |
| 40 "expected": IframeLoad.EXPECT_LOAD }, |
| 41 { "name": "'strict-dynamic' makes scheme source expressions ineffective.",
|
| 42 "required_csp": "script-src 'strict-dynamic' 'nonce-abc'", |
| 43 "returned_csp_1": "script-src http: 'strict-dynamic' 'nonce-abc'", |
| 44 "expected": IframeLoad.EXPECT_LOAD }, |
| 45 { "name": "'strict-dynamic' makes 'self' ineffective.", |
| 46 "required_csp": "script-src 'strict-dynamic' 'nonce-abc'", |
| 47 "returned_csp_1": "script-src 'self' 'strict-dynamic' 'nonce-abc'", |
| 48 "expected": IframeLoad.EXPECT_LOAD }, |
| 49 { "name": "'strict-dynamic' makes 'unsafe-inline' ineffective.", |
| 50 "required_csp": "script-src 'strict-dynamic' 'nonce-abc'", |
| 51 "returned_csp_1": "script-src 'unsafe-inline' 'strict-dynamic' 'nonce-ab
c'", |
| 52 "expected": IframeLoad.EXPECT_LOAD }, |
| 53 { "name": "'strict-dynamic' has to be allowed by required csp if it is pre
sent in returned csp.", |
| 54 "required_csp": "script-src 'nonce-abc'", |
| 55 "returned_csp_1": "script-src 'strict-dynamic' 'nonce-abc'", |
| 56 "expected": IframeLoad.EXPECT_BLOCK }, |
| 57 ]; |
| 58 tests.forEach(test => { |
| 59 async_test(t => { |
| 60 var url = generateUrlWithPolicies(Host.CROSS_ORIGIN, test.returned_csp_1
); |
| 61 if (test.returned_csp_2) |
| 62 url.searchParams.append("policy2", test.returned_csp_2); |
| 63 assert_iframe_with_csp(t, url, test.required_csp, test.expected, test.na
me, null); |
| 64 }, test.name); |
| 65 }); |
| 66 </script> |
| 67 </body> |
| 68 </html> |
OLD | NEW |