[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / workers / worker-terminate.html
1 <body>
2 <p>Test Worker.terminate().</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 worker = new Worker('resources/worker-common.js');
26 worker.terminate();
27
28 var worker2 = new Worker('resources/worker-common.js');
29 worker2.terminate();
30 worker2 = 0;
31 gc();
32
33 var worker3 = new Worker('resources/worker-common.js');
34 worker3.onmessage = function(evt) {
35     log("FAIL");
36 }
37 worker3.postMessage("eval true");
38 worker3.terminate();
39
40 var worker4 = new Worker('resources/worker-common.js');
41 worker4.onmessage = function(evt) {
42     worker4.onmessage = function() { log("FAIL"); }
43     worker4.postMessage("eval true");
44     worker4.terminate();
45     log("Received message from worker4.");
46     setTimeout("log('DONE'); if (window.layoutTestController) layoutTestController.notifyDone()", 1000);
47 }
48 worker4.postMessage("eval true");
49
50 </script>
51 </body>
52 </html>