002.html (859B)
1 <!-- 2 3 /* 4 --> 5 <!doctype html> 6 <title>navigating 2</title> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <div id=log></div> 10 <script> 11 var date; 12 var newDate; 13 </script> 14 <iframe></iframe> 15 <script> 16 var t = async_test(); 17 var iframe = document.querySelector('iframe'); 18 onload = t.step_func(function() { 19 iframe.src = "001-1.html?" + Math.random(); 20 }); 21 var start_test = t.step_func(function() { 22 window[0].document.links[0].click(); 23 }); 24 var after_load = t.step_func(function(event) { 25 newDate = new Date(); 26 setTimeout(this.step_func(function() { 27 assert_less_than(Number(date), Number(newDate)); 28 assert_equals(event.data.title, 'foo'); 29 window.removeEventListener("message", after_load); 30 this.done(); 31 }), 500); 32 }); 33 window.addEventListener("message", after_load); 34 </script> 35 <!-- 36 */ 37 //-->