tor-browser

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

cross-document-location-api.html (1024B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="resources/helpers.js"></script>
      5 <meta name="variant" content="?method=navigate">
      6 <meta name="variant" content="?method=updateCurrentEntry">
      7 
      8 <iframe id="i" src="/common/blank.html"></iframe>
      9 <script>
     10 async_test(t => {
     11  window.onload = t.step_func(() => {
     12    updateStateBasedOnTestVariant(i.contentWindow, { data : "value" });
     13    assert_equals(i.contentWindow.navigation.entries().length, 1);
     14    assert_equals(i.contentWindow.navigation.currentEntry.getState().data, "value");
     15 
     16    i.contentWindow.location.href = "?1";
     17    i.onload = t.step_func_done(() => {
     18      assert_equals(i.contentWindow.navigation.entries().length, 2);
     19      assert_equals(i.contentWindow.navigation.currentEntry.index, 1);
     20      assert_equals(i.contentWindow.navigation.currentEntry.getState(), undefined);
     21    });
     22  });
     23 }, "entry.getState() behavior after cross-document location API navigation");
     24 </script>