Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / workers / worker-messageport-gc.html
blob35d056316290996422049fa0f98c4ad111bf627f
1 <body>
2 <p>Test that workers stay reachable via message ports.
3 Should print "DONE" when done.</p>
4 <div id=result></div>
5 <script>
6 function log(message)
8 document.getElementById("result").innerHTML += message + "<br>";
11 if (window.testRunner) {
12 testRunner.dumpAsText();
13 testRunner.waitUntilDone();
16 // Test that workers stay alive even though they are only reachable via message ports.
17 var worker = new Worker("resources/worker-messageport.js");
18 var channel = new MessageChannel();
19 worker.postMessage("port", [channel.port1]);
20 worker = 0;
22 channel.port2.postMessage("ping");
23 channel.port2.onmessage = function(evt) {
24 // Other side is running, now force a GC, wait a bit, and send a new message to make sure it arrives.
25 gc();
26 setTimeout(testReachable, 100);
29 function testReachable()
31 channel.port2.onmessage = function(evt) {
32 log("PASS: Worker is reachable.");
33 done();
35 channel.port2.postMessage("ping");
38 function gc()
40 if (window.GCController)
41 return GCController.collectAll();
43 for (var i = 0; i < 10000; i++) { // force garbage collection (FF requires about 9K allocations before a collect)
44 var s = new String("abc");
48 function done()
50 log("DONE");
51 if (window.testRunner)
52 testRunner.notifyDone();
55 </script>
56 </body>
57 </html>