OLD | NEW |
(Empty) | |
| 1 HTTP/1.1 200 OK |
| 2 Content-Type: text/html |
| 3 Expires: Mon, 26 Jul 1997 05:00:00 GMT |
| 4 Cache-Control: no-store, no-cache, must-revalidate |
| 5 Cache-Control: post-check=0, pre-check=0, false |
| 6 Pragma: no-cache |
| 7 Set-Cookie: combine-multiple-policies=d0140e7d-3800-4842-b66d-370840a4569a; Path
=/content-security-policy/blink-contrib |
| 8 Content-Security-Policy: script-src 'self' 'unsafe-inline'; connect-src 'self';
style-src 'self'; report-uri /content-security-policy/support/report.py?op=put&r
eportID=d0140e7d-3800-4842-b66d-370840a4569a |
| 9 Content-Security-Policy: img-src 'none' |
| 10 |
| 11 <!DOCTYPE html> |
| 12 <html> |
| 13 |
| 14 <head> |
| 15 <!-- Programmatically converted from a WebKit Reftest, please forgive result
ing idiosyncracies.--> |
| 16 <meta http-equiv="Content-Security-Policy" content="img-src 'none'"> |
| 17 <title>combine-multiple-policies</title> |
| 18 <script src="/resources/testharness.js"></script> |
| 19 <script src="/resources/testharnessreport.js"></script> |
| 20 <script src='../support/logTest.sub.js?logs=["TEST COMPLETE"]'></script> |
| 21 <script src="../support/alertAssert.sub.js?alerts=[]"></script> |
| 22 <!-- enforcing multiple policies: |
| 23 Content-Security-Policy: script-src 'self' 'unsafe-inline'; connect-src 'self';
styls-src 'self' |
| 24 Content-Security-Policy: img-src 'none' |
| 25 --> |
| 26 </head> |
| 27 |
| 28 <body> |
| 29 This test checks that we enforce all the supplied policies. This test passe
if it doesn't alert fail and if the style doesn't apply. |
| 30 Check that a SecurityPolicyViolationEvent is fired upon blocking an image. |
| 31 <script> |
| 32 var img = document.createElement('img'); |
| 33 img.src = '../support/fail.png'; |
| 34 img.onerror = function() { |
| 35 log("TEST COMPLETE"); |
| 36 }; |
| 37 img.onload = function() { |
| 38 log("FAIL"); |
| 39 }; |
| 40 document.body.appendChild(img); |
| 41 |
| 42 </script> |
| 43 <style> |
| 44 body { |
| 45 background-color: blue; |
| 46 } |
| 47 |
| 48 </style> |
| 49 <script> |
| 50 var el = document.querySelector('body'); |
| 51 test(function() { |
| 52 assert_equals(window.getComputedStyle(el).color, "rgb(0, 0, 0)") |
| 53 }); |
| 54 |
| 55 </script> |
| 56 <div id="log"></div> |
| 57 <script async defer src="../support/checkReport.sub.js?reportExists=true&
;reportField=violated-directive&reportValue=style-src%20'self'"></
script> |
| 58 </body> |
| 59 |
| 60 </html> |
OLD | NEW |