OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Security-Policy" content="img-src 'none'"> | 4 <meta http-equiv="Content-Security-Policy" content="img-src 'none'"> |
5 <script src="/js-test-resources/js-test.js"></script> | 5 <script src="/js-test-resources/js-test.js"></script> |
6 <script src="../resources/securitypolicyviolation-test.js"></script> | 6 <script src="../resources/securitypolicyviolation-test.js"></script> |
7 <script> | 7 <script> |
8 description('Check that a SecurityPolicyViolationEvent strips detail fro
m cross-origin URLs upon blocking an image injected via script.'); | 8 description('Check that a SecurityPolicyViolationEvent strips detail fro
m cross-origin URLs upon blocking an image injected via script.'); |
9 | 9 |
10 var expectations = { | 10 var expectations = { |
11 'documentURI': document.location.toString(), | 11 'documentURI': document.location.toString(), |
12 'referrer': document.referrer, | 12 'referrer': document.referrer, |
13 'blockedURI': 'http://127.0.0.1:8000/security/resources/abe.png', | 13 'blockedURI': 'http://127.0.0.1:8000/security/resources/abe.png', |
14 'violatedDirective': 'img-src \'none\'', | 14 'violatedDirective': 'img-src \'none\'', |
15 'effectiveDirective': 'img-src', | 15 'effectiveDirective': 'img-src', |
16 'originalPolicy': 'img-src \'none\'', | 16 'originalPolicy': 'img-src \'none\'', |
17 'sourceFile': 'http://localhost:8000', | 17 'sourceFile': '', |
18 'lineNumber': 3, | 18 'lineNumber': 0, |
19 'columnNumber': 7, | 19 'columnNumber': 0, |
20 'statusCode': 200, | 20 'statusCode': 200, |
21 }; | 21 }; |
22 | 22 |
23 function run() { | 23 function run() { |
24 var script = document.createElement('script'); | 24 var script = document.createElement('script'); |
25 script.src = 'http://localhost:8000/security/contentSecurityPolicy/r
esources/inject-image.js'; | 25 script.src = 'http://localhost:8000/security/contentSecurityPolicy/r
esources/inject-image.js'; |
26 document.body.appendChild(script); | 26 document.body.appendChild(script); |
27 } | 27 } |
28 </script> | 28 </script> |
29 </head> | 29 </head> |
30 <body> | 30 <body> |
31 </body> | 31 </body> |
32 </html> | 32 </html> |
OLD | NEW |