intercept-detach-multiple.html (658B)
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 async_test(t => { 7 window.onload = t.step_func(() => { 8 let second_handler_run = false; 9 i.contentWindow.navigation.onnavigate = e => { 10 e.intercept({ handler() { i.remove(); }}); 11 e.intercept({ handler() { second_handler_run = true; }}); 12 }; 13 14 i.contentWindow.location.href = "#1"; 15 t.step_timeout(t.step_func_done(() => assert_true(second_handler_run)), 0); 16 }); 17 }, "event.intercept() throws if used on an event from a detached iframe"); 18 </script>