| testRunner.waitUntilDone(); |
| var worker = new Worker("resources/wrapper-map-gc.js"); |
| // Post the message from worker back to the worker. |
| // This will fire another onmessage event in the Worker and allocate more data. |
| worker.onmessage = function(evt) |
| worker.postMessage(evt.data); |
| // This appears to be enough to reliably trigger GC in a Worker (about 20Mb strings allocated). |
| document.getElementById("result").innerText = "PASS"; |
| <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> |