prompt-and-unload-script-uncloseable.html (755B)
1 <!doctype html> 2 <title>beforeunload and unload events do not fire after window.close() in script-uncloseable browsing context</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <div id="log"></div> 6 <script> 7 var beforeunload_fired = false; 8 var unload_fired = false; 9 var t = async_test(); 10 11 onload = t.step_func(function() { 12 var iframe = document.getElementsByTagName("iframe")[0] 13 iframe.onload = t.step_func(function() { 14 iframe.contentWindow.close() 15 t.step_timeout(function() { 16 assert_false(beforeunload_fired); 17 assert_false(unload_fired); 18 t.done(); 19 }, 1000); 20 }); 21 iframe.src = "prompt-and-unload-script-uncloseable-1.html"; 22 }); 23 </script> 24 <iframe></iframe>