[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / workers / wrapper-map-gc.html
1 <script>
2 function test()
3 {
4     if (window.layoutTestController) {
5         layoutTestController.dumpAsText();
6         layoutTestController.waitUntilDone();
7     }
8
9     var counter = 0;
10     var worker = new Worker("resources/wrapper-map-gc.js");
11
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)
15     {
16         worker.postMessage(evt.data);
17         // This appears to be enough to reliably trigger GC in a Worker (about 20Mb strings allocated).
18         if (++counter > 20) {
19             document.getElementById("result").innerText = "PASS";
20             worker.terminate();
21             if (window.layoutTestController) {
22                 layoutTestController.notifyDone();
23             }
24         }
25     }
26 }
27 </script>
28 <body onload=test()>
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>
31 </body>
32 </html>