tor-browser

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

traverseTo-after-adding-iframe.html (1432B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <body>
      5 <script>
      6 async_test(t => {
      7  let start_length = navigation.entries().length;
      8 
      9  // Wait for after the load event so that the navigation doesn't get converted
     10  // into a replace navigation.
     11  window.onload = () => t.step_timeout(() => {
     12    navigation.navigate("#top");
     13    assert_equals(navigation.entries().length, start_length + 1);
     14 
     15    let i = document.createElement("iframe");
     16    i.src = "/common/blank.html";
     17    document.body.appendChild(i);
     18    i.onload = () => t.step_timeout(() => {
     19      assert_equals(i.contentWindow.navigation.entries().length, 1);
     20      i.contentWindow.navigation.navigate("#fragment");
     21      assert_equals(i.contentWindow.navigation.entries().length, 2);
     22      i.contentWindow.navigation.back().committed.then(t.step_func(() => {
     23        assert_equals(i.contentWindow.navigation.entries().length, 2);
     24        assert_equals(i.contentWindow.navigation.currentEntry.index, 0);
     25        return i.contentWindow.navigation.forward().committed;
     26      })).then(t.step_func_done(() => {
     27        assert_equals(i.contentWindow.navigation.entries().length, 2);
     28        assert_equals(i.contentWindow.navigation.currentEntry.index, 1);
     29      }));
     30    }, 0);
     31  }, 0);
     32 }, "navigation.traverseTo() should work in an iframe that is not present in all history entries");
     33 </script>
     34 </body>