JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / http / tests / misc / script-async.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <script src="../../js-test-resources/js-test-pre.js"></script>
6 </head>
7 <body onload="test()">
8 This tests for proper execution order of scripts with the async attribute <a href="https://bugs.webkit.org/show_bug.cgi?id=20710">https://bugs.webkit.org/show_bug.cgi?id=20710</a>.<hr>
9 <div id="console"></div>
10 <script type="text/javascript">
11 var jsTestIsAsync = true;
12
13 function debug(msg)
14 {
15     if (!window.status_)
16         window.status_ = '';
17     window.status_ += ' ' + msg + ' ';
18 }
19
20 document.addEventListener("DOMContentLoaded", function() {
21     debug('DOMContentLoaded');
22 }, false);
23
24 function test()
25 {
26     var expectedA = " async  external  inline  DOMContentLoaded  slowAsync ";
27     var expectedB = " external  async  inline  DOMContentLoaded  slowAsync ";
28     var expectedC = " external  inline  async  DOMContentLoaded  slowAsync ";
29     var expectedD = " external  inline  DOMContentLoaded  async  slowAsync ";
30     var results = "PASS";
31     if (window.status_ != expectedA && window.status_ != expectedB && window.status_ != expectedC && window.status_ != expectedD)
32         results = "FAIL: Expected one of '" + expectedA + "' || '" + expectedB + "' || '" + expectedC + "' || '" + expectedD + "', Actual='" + window.status_ + "'";
33     document.getElementById("console").innerHTML = results;
34     finishJSTest();
35 }
36
37 var successfullyParsed = true;
38 </script>
39 <script src="http://127.0.0.1:8000/misc/resources/slow-async-script.cgi" async="ASYNC"></script>
40 <script src="http://127.0.0.1:8000/misc/resources/async-script.js" async="ASYNC"></script>
41 <script src="http://127.0.0.1:8000/misc/resources/external-script.js"></script>
42 <script>
43 debug("inline");
44 </script>
45 <script src="../../js-test-resources/js-test-post.js"></script>
46 </body>
47 </html>
48
49