[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / workers / worker-gc.html
1 <body>
2 <p>Test worker garbage collection. Should print "SUCCESS".</p>
3 <div id=result></div>
4 <script>
5 function log(message)
6 {
7     document.getElementById("result").innerHTML += message + "<br>";
8 }
9
10 function gc()
11 {
12     if (window.GCController)
13         return GCController.collect();
14
15     for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
16         var s = new String("abc");
17     }
18 }
19
20 if (window.layoutTestController) {
21     layoutTestController.dumpAsText();
22     layoutTestController.waitUntilDone();
23 }
24
25 var interval = setInterval(gc, 0);
26
27 var worker = new Worker('resources/worker-common.js');
28 worker.postMessage("ping");
29 worker.onmessage = function(evt) {
30     this.postMessage("ping");
31     this.onmessage = function() {
32         log("SUCCESS");
33         clearInterval(interval);
34         if (window.layoutTestController)
35             layoutTestController.notifyDone();
36     }
37     
38 }
39 worker = 0;
40 gc();
41 </script>
42 </body>
43 </html>