tor-browser

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

key-id-back-same-document.html (1001B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script>
      5 async_test(t => {
      6  let start_length = navigation.entries().length;
      7  let start_index = navigation.currentEntry.index;
      8  let key = navigation.currentEntry.key;
      9  let id = navigation.currentEntry.id;
     10 
     11  history.pushState("hash", "", "#hash");
     12  assert_not_equals(key, navigation.currentEntry.key);
     13  assert_not_equals(id, navigation.currentEntry.id);
     14  assert_equals(navigation.entries().length, start_length + 1);
     15  assert_equals(navigation.currentEntry.index, start_index + 1);
     16 
     17  window.onpopstate = t.step_func_done(() => {
     18    assert_equals(key, navigation.currentEntry.key);
     19    assert_equals(id, navigation.currentEntry.id);
     20    assert_equals(navigation.entries().length, start_length + 1);
     21    assert_equals(navigation.currentEntry.index, start_index);
     22  });
     23  history.back();
     24 }, "NavigationHistoryEntry's key and id on same-document back navigation");
     25 </script>