2 <p>Test Worker constructor functionality. Should print a series of PASS messages, followed with DONE.</p>
7 document.getElementById("result").innerHTML += message + "<br>";
10 if (window.layoutTestController) {
11 layoutTestController.dumpAsText();
12 layoutTestController.waitUntilDone();
16 new Worker({toString:function(){throw "exception"}})
17 log("FAIL: toString exception not propagated.");
19 if (ex == "exception")
20 log("PASS: toString exception propagated correctly.");
22 log("FAIL: unexpected exception (" + ex + ") received instead of one propagated from toString.");
26 var foo = {toString:function(){new Worker(foo)}}
28 log("FAIL: no exception when trying to create workers recursively");
30 log("PASS: trying to create workers recursively resulted in an exception (" + ex + ")");
35 log("FAIL: invoking Worker constructor without arguments did not result in an exception");
37 log("PASS: invoking Worker constructor without arguments resulted in an exception (" + ex + ")");
41 var worker = new Worker("does-not-exist.js");
42 worker.onerror = function() {
43 log("PASS: onerror invoked for a script that could not be loaded.");
45 if (window.layoutTestController)
46 layoutTestController.notifyDone();
49 log("FAIL: unexpected exception " + ex);
50 if (window.layoutTestController)
51 layoutTestController.notifyDone();