tor-browser

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

traverse-during-unload.html (759B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Traversing the history during unload</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 
      7 <body>
      8 <script>
      9 "use strict";
     10 
     11 async_test(t => {
     12  const w = window.open("resources/message-opener.sub.html?id=start");
     13  t.add_cleanup(() => w.close());
     14 
     15  const messages = [];
     16  window.addEventListener("message", t.step_func(({ data }) => {
     17    messages.push(data);
     18 
     19    if (messages.length === 1) {
     20      assert_array_equals(messages, ["start"]);
     21      w.location.href = "resources/traverse-during-unload.html";
     22    } else if (messages.length === 2) {
     23      assert_array_equals(messages, ["start", "destination"]);
     24      t.done();
     25    }
     26  }));
     27 });
     28 </script>