chromium/third_party/blink/web_tests/http/tests/loading/onreadystatechange-window-stop.html

<title>
  This test ensures that page cannot stop navigation away from itself by calling
  window.stop() from onreadystatechange.
</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<a href="?done">click me</a>
<script>
setup({single_test: true});

if (!location.search) {
  document.addEventListener('readystatechange', () => {
    window.stop();
  });
  document.querySelector('a').click();
} else {
  assert_equals(location.search, "?done");
  done();
}
</script>