blob: ac5c3e1c1fe89725146592a299731e2abed765c4 [file] [log] [blame]
<!DOCTYPE html>
<!--
This test was modified to not use the HTML4 intrinsic events 'img onload=' or
'img=onerror'.
-->
<html>
<head>
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
<title>image-blocked</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../support/logTest.sub.js?logs=[]"></script>
<script src='../support/alertAssert.sub.js?alerts=["PASS"]'></script>
<!-- enforcing policy:
img-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-inline'; connect-src 'self';
-->
</head>
<body>
This test passes if it doesn&apos;t alert FAIL and does alert PASS.
<div id='t1'></div>
<script>
var t1img = document.createElement('img');
t1img.onload = function() { alert_assert("FAIL"); }
t1img.onerror = function() { alert_assert("PASS"); }
t1img.src = '../support/pass.png';
var t1div = document.getElementById('t1');
t1div.appendChild(t1img);
</script>
<div id="log"></div>
<script async defer src="../support/checkReport.sub.js?reportExists=true&amp;reportField=violated-directive&amp;reportValue=img-src%20&apos;none&apos;"></script>
</body>
</html>