4 if (window
.testRunner
) {
5 testRunner
.dumpAsText();
6 testRunner
.waitUntilDone();
10 var worker
= new Worker("resources/wrapper-map-gc.js");
12 // Post the message from worker back to the worker.
13 // This will fire another onmessage event in the Worker and allocate more data.
14 worker
.onmessage = function(evt
)
16 worker
.postMessage(evt
.data
);
17 // This appears to be enough to reliably trigger GC in a Worker (about 20Mb strings allocated).
19 document
.getElementById("result").innerText
= "PASS";
21 if (window
.testRunner
) {
22 testRunner
.notifyDone();
29 <p>This test tries to cause GC in Worker context. It also fires events in the Worker, which allocates JS DOM Wrappers for Event object. As a result of GC, the maps that map wrappers to DOM Objects will be cleaned up. Test succeeds if it does not crash and prints 'PASS' at the end.
</p>
30 <pre id=
"result"></pre>