015.html (1540B)
1 <!DOCTYPE html> 2 <html><head> 3 <title> scheduler: DOM added inline+external+inline script earlier in document</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="testlib/testlib.js"></script> 7 </head> 8 <body> 9 10 <div id="log">FAILED (This TC requires JavaScript enabled)</div> 11 12 <script>log('inline script #1'); 13 testlib.addScript('log(\'head script #1\')', {}, document.getElementsByTagName('head')[0], false); 14 var s = testlib.addScript('', { 'src':'scripts/include-1.js' }, document.getElementsByTagName('head')[0], false); 15 testlib.addScript('log(\'head script #2\')', {}, document.getElementsByTagName('head')[0], false); 16 log('end script #1'); 17 </script> 18 19 <script type="text/javascript"> 20 log( 'inline script #2' ); 21 var t = async_test() 22 23 ///XXX I think the spec allows this case to race 24 onload = function(){ 25 setTimeout(t.step_func( 26 function() { 27 assert_any(assert_array_equals, eventOrder, [['inline script #1', 'head script #1', 'head script #2', 'end script #1', 'external script #1', 'inline script #2'], 28 ['inline script #1', 'head script #1', 'head script #2', 'end script #1', 'inline script #2', 'external script #1']]); 29 t.done(); 30 }), 31 100);} 32 </script> 33 34 </body></html>