abort-document-load.html (1123B)
1 <!doctype html> 2 <title>Aborting a Document load</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/browsing-the-web.html#aborting-a-document-load"> 6 <div id="log"></div> 7 <script> 8 var events = []; 9 onmessage = function(e) { 10 events.push(e.data); 11 }; 12 async_test(test => { 13 test.step_timeout(() => { 14 const frame = document.querySelector('iframe'); 15 const child = frame.contentWindow; 16 assert_equals(child.document.readyState, 'complete', 'readyState is complete'); 17 assert_array_equals(events, ["loading", "stop"], 'no load event was fired'); 18 events = []; 19 frame.src = "abort-document-load-2.html"; 20 21 test.step_timeout(() => { 22 const child = frame.contentWindow; 23 assert_equals(child.document.readyState, 'complete', 'readyState is complete'); 24 assert_array_equals(events, ["loading", "DOMContentLoaded", "stop", "complete"], 'no load event was fired'); 25 test.done(); 26 }, 1000); 27 }, 1000); 28 }); 29 </script> 30 <iframe src="abort-document-load-1.html"></iframe>