blob: a5d8ab8c461d68c443d1fa955e278730f923d662 [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
}
function unloadHandler() {
document.getElementById('result').innerHTML = "PASS";
}
function loadHandler() {
document.getElementById('result').innerHTML = "FAIL - load event should not fire if security check failed.";
}
function test()
{
var w = window.open('http://127.0.0.1:8080/security/resources/has-window-events.html');
w.addEventListener('unload', unloadHandler, false);
w.addEventListener('load', loadHandler, false);
}
</script>
<body onload='test()'>
Test that window event handlers set for initial document are reset upon navigation if security check failed. There will be 'PASS' below if the test passes:<br>
<div id='result'>FAIL - nothing happened</div>