tor-browser

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

activation-history-pushState.html (872B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script>
      5 promise_test(async t => {
      6  // Wait for after the load event so that the navigation doesn't get converted
      7  // into a replace navigation.
      8  await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
      9 
     10  assert_equals(navigation.activation.entry, navigation.currentEntry);
     11  let activationEntry = navigation.activation.entry;
     12  let entryIndexBeforePush = activationEntry.index;
     13  history.pushState("#fragment", "", "");
     14  assert_not_equals(navigation.activation.entry, navigation.currentEntry);
     15  assert_equals(navigation.activation.entry, activationEntry);
     16  assert_equals(navigation.activation.entry.index, entryIndexBeforePush);
     17 }, "navigation.activation.entry should not change due to history.pushState()");
     18 </script>