blob: d9c12d2b17bcf75145d2cd08c7aca72fabb48a63 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
<meta http-equiv="Content-Security-Policy" content="img-src 'none'; script-src 'unsafe-inline'">
<script>
if (window.testRunner)
testRunner.waitUntilDone();
function test() {
(function () {
var img = document.createElement('img');
img.onload = function () {
alert('FAIL (1/1)');
finishTesting();
};
img.onerror = function () {
alert('PASS (1/1)');
finishTesting();
};
img.src = "../resources/abe.png";
})();
gc();
}
function finishTesting() {
if (window.testRunner)
setTimeout(function () { testRunner.notifyDone(); }, 0);
return true;
}
</script>
</head>
<body onload='test();'>
<p>
This test ensures that blocking an image via CSP doesn't crash if GC
executes before the error event fires.
</p>
</body>
</html>