chromium/third_party/blink/web_tests/fast/events/resources/subframe-stop-load-in-unload-handler-using-window-stop.html

<script>
    window.location = "pass.html";

    window.onunload = function()
    {
        window.stop();
        setTimeout("parent.log('You wanted to go to: '+ location.href); parent.fail()", 500);
    }
</script>