chromium/third_party/blink/web_tests/http/tests/navigation/form-submit-window-stop-in-onreadystatechange.html

<script>
  /*
    Regression test for https://crbug.com/856759.
    This test passes if it doesn't crash.
  */

  if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
  }

  document.addEventListener("DOMContentLoaded", function(event) {
    document.onreadystatechange = function() {
      window.stop();
      setTimeout(function() {
        location.href = "/resources/notify-done.html";
      }, 0);
    };
    document.querySelector("form").submit();
  })

</script>

<body>
  <form action="/resources/notify-done.html"></form>

  <!-- Prevent the document from finishing loading -->
  <iframe src="/resources/slow-script.pl?delay=999"></iframe>
</body>