beforeunload-on-navigation-of-parent.html (752B)
1 <!doctype html> 2 <title>beforeunload in iframe on navigation of parent</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <div id="log"></div> 6 <script> 7 beforeunload_fired = false; 8 var t = async_test(); 9 10 var base_count = 0; 11 12 onload = function() {setTimeout(t.step_func(function() { 13 var iframe = document.getElementsByTagName("iframe")[0] 14 iframe.onload = t.step_func(function() { 15 iframe.onload = null; 16 history.go(-1); 17 }); 18 19 iframe.src = "beforeunload-on-navigation-of-parent-1.html"; 20 }), 100)}; 21 22 base_show = t.step_func(function() { 23 base_count++; 24 if (base_count > 1) { 25 assert_true(beforeunload_fired); 26 t.done(); 27 } 28 }); 29 30 </script> 31 <iframe src="base.html"></iframe>