056.html (1101B)
1 <!DOCTYPE html> 2 <html><head> 3 <title> scheduler: appending code to initially empty SCRIPT tag in DOM </title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="testlib/testlib.js"></script> 7 <script></script> 8 </head> 9 <body> 10 11 <div id="log">FAILED (This TC requires JavaScript enabled)</div> 12 13 <script>log('inline script #1'); 14 var script=document.getElementsByTagName('script')[3]; 15 script.appendChild( document.createTextNode('log("injected script code");') ); 16 log('end script #1'); 17 </script> 18 <script type="text/javascript"> 19 log( 'inline script #2' ); 20 var t = async_test() 21 22 function test() { 23 // Test asserts the injected script should run 24 assert_array_equals(eventOrder, ['inline script #1', 'injected script code', 'end script #1', 'inline script #2']); 25 t.done(); 26 } 27 onload = t.step_func(test); 28 </script> 29 30 </body></html>