blob: 88a769396d2e3f3d834586376e6bf68282708b07 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="img-src 'none'">
<script src="/js-test-resources/js-test.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',
'effectiveDirective': 'img-src',
'originalPolicy': 'img-src \'none\'',
'disposition': 'enforce',
'sourceFile': '',
'lineNumber': 0,
'columnNumber': 0,
'statusCode': 200,
};
function run() {
var img = document.createElement('img');
img.src = '/security/resources/abe.png';
document.body.appendChild(img);
}
</script>
</head>
<body>
</body>
</html>