tor-browser

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

navigate-form-userInitiated.html (1215B)


      1 <!doctype html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/resources/testdriver.js"></script>
      5 <script src="/resources/testdriver-vendor.js"></script>
      6 <script src="/resources/testdriver-actions.js"></script>
      7 <form id="form" method="post" action="">
      8 <input id="submit" name="submitter" type="submit" value="Submit">
      9 </form>
     10 <script>
     11 async_test(t => {
     12  navigation.onnavigate = t.step_func_done(e => {
     13    e.preventDefault();
     14 
     15    assert_equals(e.navigationType, "push");
     16    assert_true(e.cancelable);
     17    assert_true(e.canIntercept);
     18    assert_true(e.userInitiated);
     19    assert_false(e.hashChange);
     20    assert_equals(e.downloadRequest, null);
     21    assert_equals(e.destination.url, location.href);
     22    assert_false(e.destination.sameDocument);
     23    assert_equals(e.destination.key, "");
     24    assert_equals(e.destination.id, "");
     25    assert_equals(e.destination.index, -1);
     26    assert_not_equals(e.formData, null);
     27    assert_equals(e.formData.get("submitter"), "Submit");
     28    assert_equals(e.sourceElement, submit);
     29  });
     30  window.onload = t.step_func(() => test_driver.click(submit));
     31 }, "<form> submission fires navigate event");
     32 </script>