tor-browser

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

navigate-navigation-navigate.html (1025B)


      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  await new Promise(resolve => addEventListener('load', () => t.step_timeout(resolve, 0), {once: true}));
      7 
      8  let { promise, resolve } = Promise.withResolvers();
      9  navigation.onnavigate = t.step_func_done(e => {
     10    assert_equals(e.navigationType, "push");
     11    assert_true(e.cancelable);
     12    assert_true(e.canIntercept);
     13    assert_false(e.userInitiated);
     14    assert_true(e.hashChange);
     15    assert_equals(e.downloadRequest, null);
     16    assert_equals(new URL(e.destination.url).hash, "#foo");
     17    assert_true(e.destination.sameDocument);
     18    assert_equals(e.destination.key, "");
     19    assert_equals(e.destination.id, "");
     20    assert_equals(e.destination.index, -1);
     21    assert_equals(e.formData, null);
     22    assert_equals(e.sourceElement, null);
     23    resolve();
     24  });
     25  navigation.navigate("#foo");
     26  await promise;
     27 }, "navigate event for navigation.navigate()");
     28 </script>