tor-browser

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

intercept-resolve.html (690B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script>
      5 async_test(t => {
      6  navigation.onnavigatesuccess = t.step_func_done(e => {
      7    assert_equals(location.hash, "#1");
      8    assert_equals(e.constructor, Event);
      9    assert_false(e.bubbles);
     10    assert_false(e.cancelable);
     11  });
     12  navigation.onnavigateerror = t.step_func_done(assert_unreached);
     13  navigation.onnavigate = e => {
     14    e.intercept({ handler: () => new Promise(resolve => t.step_timeout(resolve, 0)) });
     15  };
     16 
     17  location.href = "#1";
     18  assert_equals(location.hash, "#1");
     19 }, "event.intercept() should proceed if the given promise resolves");
     20 </script>