| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta http-equiv="Content-Security-Policy" content="img-src 'none'"> |
| <script src="/js-test-resources/js-test-pre.js"></script> |
| <script src="../resources/securitypolicyviolation-test.js"></script> |
| <script> |
| description('Check that a SecurityPolicyViolationEvent is fired upon blocking an image.'); |
| |
| var expectations = { |
| 'documentURI': document.location.toString(), |
| 'referrer': document.referrer, |
| 'blockedURI': 'http://127.0.0.1:8000/security/resources/abe.png', |
| 'violatedDirective': 'img-src \'none\'', |
| 'effectiveDirective': 'img-src', |
| 'originalPolicy': 'img-src \'none\'', |
| 'sourceFile': document.location.toString(), |
| 'lineNumber': 25, |
| 'columnNumber': 16, |
| 'statusCode': document.location.protocol === 'http:' ? 200 : 0, |
| }; |
| |
| function run() { |
| var img = document.createElement('img'); |
| img.src = 'http://127.0.0.1:8000/security/resources/abe.png'; |
| document.body.appendChild(img); |
| } |
| </script> |
| <script src="/js-test-resources/js-test-post.js"></script> |
| </head> |
| <body> |
| </body> |
| </html> |