navigate-anchor-cross-origin.html (975B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/common/get-host-info.sub.js"></script> 5 <a id="a"></a> 6 <script> 7 async_test(t => { 8 navigation.onnavigate = t.step_func_done(e => { 9 assert_equals(e.navigationType, "push"); 10 assert_true(e.cancelable); 11 assert_false(e.canIntercept); 12 assert_false(e.userInitiated); 13 assert_false(e.hashChange); 14 assert_equals(e.formData, null); 15 assert_equals(e.downloadRequest, null); 16 assert_equals(e.destination.url, a.href); 17 assert_false(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.sourceElement, document.getElementById("a")); 22 e.preventDefault(); 23 }); 24 a.href = get_host_info().HTTPS_REMOTE_ORIGIN + "/does-not-exist.html"; 25 a.click(); 26 }, "<a> cross-origin navigate event"); 27 </script>