intercept-canceled-event.html (530B)
1 <!doctype html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <iframe id="i" src="/common/blank.html"></iframe> 5 <script> 6 test(t => { 7 let assertionHappened = false; 8 navigation.onnavigate = t.step_func_done(e => { 9 e.preventDefault(); 10 assert_throws_dom("InvalidStateError", () => e.intercept()); 11 assertionHappened = true; 12 }); 13 14 location.href = "#1"; 15 assert_true(assertionHappened); 16 }, "event.intercept() throws if used on a canceled event"); 17 </script>