chromium/third_party/blink/web_tests/fast/loader/unload-javascript-url.html

<script>
addEventListener("unload", function() {
  window.location = "javascript:alert('FAIL')";
}, false);
</script>
<script>
if (window.testRunner) {
  testRunner.dumpAsText();
  testRunner.waitUntilDone();
}
window.location = "resources/pass-and-notify-done.html";
</script>