tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

navigate-to-about-blank-while-initial-load-pending.html (1179B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Test navigating to about:blank while window.open initial load pending.</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <div id="log"></div>
      7 <script>
      8 async_test(t => {
      9  // Open a new window and initiate a navigation. The test does not actually
     10  // expect this navigation to complete so it does not matter what URL is
     11  // used other than it must not be about:blank. The intent is to start a
     12  // navigation to some URL and then assign about:blank to the location
     13  // attribute. This assignment should stop the inital navigation and start a
     14  // new navigation to about:blank. When the about:blank page finishes loading
     15  // the load event is expected to fire and the document URL should to be set to
     16  // about:blank.
     17  var window1 = window.open('resources/post-to-opener.html', '_blank');
     18  t.add_cleanup(() => {
     19    window1.close();
     20  });
     21  window1.location = 'about:blank';
     22  window1.onload = t.step_func_done(e => {
     23    assert_equals(window1.document.URL, "about:blank");
     24  });
     25 }, 'Navigating to about:blank while window.open initial load pending.');
     26 </script>