004.html (867B)
1 <!doctype html> 2 <title>pagehide / unload event order</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <div id="log"></div> 6 <script> 7 var t = async_test(); 8 9 var events = []; 10 11 onload = function() {setTimeout(function() { 12 var iframe = document.getElementsByTagName("iframe")[0] 13 14 iframe.onload = function() { 15 setTimeout(function() { 16 iframe.contentWindow.location="001-2.html"; 17 }, 100); 18 iframe.onload = t.step_func(function() { 19 assert_array_equals(events, ["pagehide", "unload"]) 20 t.done()}); 21 }; 22 23 iframe.src = "004-1.html?" + Math.random(); 24 25 }, 100)}; 26 27 </script> 28 <iframe></iframe>