Use testRunner instead of layoutTestController in fast/doctypes, dom, dynamic, encodi...
[WebKit-https.git] / LayoutTests / fast / dom / HTMLScriptElement / script-set-src.html
1 <html>
2 <head>
3 <script type="text/javascript">
4 var p5result = "FAIL";
5
6 function test()
7 {
8     if (window.testRunner) {
9         testRunner.dumpAsText();
10         testRunner.waitUntilDone();
11     }
12
13     document.getElementById("p5").innerHTML = p5result;
14     
15     document.getElementById("s1").src = "resources/script-set-src-p1fail.js";
16     document.getElementById("s2").src = "resources/script-set-src-p2fail.js";
17     document.getElementById("s5").src = "resources/script-set-src-p5fail.js";
18     document.getElementById("s3").src = "resources/script-set-src-p3pass.js";
19     document.getElementById("s6").setAttribute("src", "resources/script-set-src-p6pass.js");
20     
21     var e1 = document.createElement( "script" );
22     e1.type  = "text/javascript";
23     e1.src = "resources/script-set-src-p7pass.js";
24     document.getElementsByTagName("head")[0].appendChild(e1);
25
26     var e2 = document.createElement( "script" );
27     e2.type  = "text/javascript";
28     document.getElementsByTagName("head")[0].appendChild(e2);
29     e2.src = "resources/script-set-src-p8pass.js";
30     
31     var e3 = document.createElement( "script" );
32     e3.type  = "text/javascript";
33     e3.setAttribute("onload", "if (window.testRunner) setTimeout('testRunner.notifyDone()', 100)"); 
34     e3.src = "resources/script-set-src-p9failBefore.js";
35     e3.src = "resources/script-set-src-p9pass.js";
36     document.getElementsByTagName("head")[0].appendChild(e3);
37     e3.src = "resources/script-set-src-p9failAfter.js";
38     
39 }
40 </script>
41 <script type="text/javascript" id="s1">
42 // Parser-created. Has text so it should not load upon setting src.
43 </script>
44 <script type="text/javascript" id="s2" src="resources/thisShouldNotExist.null"></script>
45 <script type="text/javascript" id="s5" src="resources/script-set-src-p5pass.js"></script>
46 <script type="text/javascript" id="s3"></script>
47 <!-- s4 was a self-closing script tag, however that is covered by fast/parser/script-tag-with-trailing-slash.html -->
48 <script type="text/javascript" id="s6"></script>
49 </head>
50 <body onload="test();">
51 <p>Parser-created script elements:</p>
52 <p>Already containing text: <span id="p1">PASS</span></p>
53 <p>Already specifying missing source: <span id="p2">PASS</span></p>
54 <p>Already specifying valid source: <span id="p5">FAIL</span></p>
55 <p>No text and no source: <span id="p3">FAIL</span></p>
56 <p>Using setAttribute: <span id="p6">FAIL</span></p>
57 <hr>
58 <p>Dynamically-inserted script elements:</p>
59 <p>Set before insertion: <span id="p7">FAIL</span></p>
60 <p>Set after insertion: <span id="p8">FAIL</span></p>
61 <p>Set twice before and once after insertion: <span id="p9">FAIL</span></p>
62 </body>