tor-browser

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

001.html (1082B)


      1 <!doctype html>
      2 <title>pageshow event from traversal</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <div id="log"></div>
      6 <iframe src="001-1.html"></iframe>
      7 <script>
      8 var t = async_test();
      9 var events = [];
     10 var iframe = document.getElementsByTagName("iframe")[0];
     11 
     12 onload = t.step_func(function() {
     13  setTimeout(t.step_func(
     14    function() {
     15      assert_equals(iframe.contentDocument.readyState, "complete")
     16      iframe.src = "001-2.html";
     17    }), 500);
     18  onload = null;
     19 })
     20 
     21 do_test = t.step_func(function() {
     22  assert_equals(events.length, 2);
     23  events.forEach(function(e, i) {
     24    phase = i ? "after" : "before";
     25    assert_equals(e.type, "pageshow", "type " + phase + " navigation");
     26 
     27    // https://github.com/whatwg/html/issues/6794
     28    assert_equals(e.bubbles, true, "bubbles " + phase + " navigation");
     29    assert_equals(e.cancelable, true, "cancelable " + phase + " navigation");
     30 
     31    assert_equals(e.persisted, i == 0 ? false : true, "persisted " + phase + " navigation");
     32    t.done();
     33  });
     34 });
     35 </script>