prompt-and-unload-script-closeable.html (578B)
1 <!doctype html> 2 <title>beforeunload and unload events fire after window.close() in script-closeable browsing context</title> 3 <meta name="timeout" content="long"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <div id="log"></div> 7 <script> 8 beforeunload_fired = false; 9 var t = async_test(); 10 11 onload = t.step_func(function() { 12 window.close(); 13 }); 14 15 onbeforeunload = t.step_func(function() { 16 beforeunload_fired = true; 17 }); 18 19 onunload = t.step_func(function() { 20 assert_true(beforeunload_fired); 21 t.done() 22 }); 23 </script>