Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / workers / worker-workerScriptNotThere.html
blob26a40916c23946859e38724c9c2106b6f9d78274
1 <html>
2 <body>
3 <p>Test worker file does not exist error. Should print two "PASS" statements followed by "DONE".</p>
4 <p>The order of the error events should be onerror and then error event, and this test should be improved to verify that when bug https://bugs.webkit.org/show_bug.cgi?id=62485 is fixed.</p>
5 <div id=result></div>
6 <script>
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
11 function log(message)
13 document.getElementById("result").innerHTML += message + "<br>";
16 function done()
18 log("DONE");
19 if (window.testRunner)
20 testRunner.notifyDone();
23 var eventCount = 0;
25 function eventDone()
27 eventCount++;
28 if (eventCount == 2)
29 done();
32 var worker;
33 try {
34 worker = new Worker("this-file-does-should-not-exist.js");
35 } catch (error) {
36 log("FAIL: Exception thrown.");
39 worker.addEventListener('error', function(error) {
40 log("PASS: error event.");
41 eventDone();
42 }, false);
44 worker.onerror = function(error) {
45 log("PASS: onerror called.");
46 eventDone();
49 </script>
50 </body>
51 </html>