chromium/third_party/blink/web_tests/http/tests/security/window-events-pass.html

<html>
<head>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
    testRunner.setPopupBlockingEnabled(false);
}

function pagehideHandler() {
    document.getElementById('result').innerHTML = "PASS: pagehide fired.";
}

function loadHandler() {
    document.getElementById('result').innerHTML += "<br>PASS: load fired.";
}

function test()
{
    var w = window.open('http://127.0.0.1:8000/security/resources/has-window-events.html');
    w.addEventListener('pagehide', pagehideHandler, false);
    w.addEventListener('load', loadHandler, false);
}

</script>
<body onload='test()'>
Test that window event handlers set for initial document are kept if security check passes. There will be 2 'PASS' messages below if the test passes:<br>
<div id='result'>FAIL</div>