WebCore:
[WebKit-https.git] / LayoutTests / http / tests / xmlhttprequest / workers / xmlhttprequest-file-not-found.html
1 <html>
2 <body>
3 <p>Request a file that isn't present on the server in XMLHttpRequest in a worker.  If this test passes, there should be a single PASS below.</p>
4 <script>
5     if (window.layoutTestController) {
6         layoutTestController.dumpAsText();
7         layoutTestController.waitUntilDone();
8     }
9
10     var console_messages = document.createElement("ul");
11     document.body.appendChild(console_messages);
12
13     function log(message)
14     {
15         var item = document.createElement("li");
16         item.appendChild(document.createTextNode(message));
17         console_messages.appendChild(item);
18     }
19
20     var worker = new Worker('resources/xmlhttprequest-file-not-found.js');
21     worker.onmessage = function(evt)
22     {
23         if (/log .+/.test(evt.data))
24             log(evt.data.substr(4));
25         else if (/DONE/.test(evt.data)) {
26             log("PASS");
27             if (window.layoutTestController)
28                 layoutTestController.notifyDone();
29         }
30     }
31 </script>
32 </body>
33 </html>