2 <p>Test SharedWorker onerror functionality. Prints multiple SUCCESS lines, then DONE when complete.
</p>
7 document
.getElementById("result").innerHTML
+= message
+ "<br>";
10 if (window
.testRunner
) {
11 testRunner
.dumpAsText();
12 testRunner
.waitUntilDone();
15 function testSimpleLoadError()
17 var worker
= new SharedWorker("file_does_not_exist.js", "name");
18 worker
.onerror = function(evt
) {
19 log("PASS: Received load error event: " + evt
);
24 function testLoadErrorGC()
26 var worker
= new SharedWorker("file_does_not_exist.js", "name");
27 worker
.onerror
= handleError
;
34 if (window
.GCController
)
35 return GCController
.collect();
37 for (var i
= 0; i
< 10000; i
++) { // force garbage collection (FF requires about 9K allocations before a collect)
38 var s
= new String("abc");
43 function handleError(evt
) {
44 log("PASS: Received error event after worker GC'd: " + evt
);
46 if (window
.testRunner
)
47 testRunner
.notifyDone();
50 testSimpleLoadError();