Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / message-port-deleted-frame.html
blob30599a386c35125bb23bb643e72c854c60a52d20
1 <body>
2 <p>Test that destroying a frame doesn't cause a crash when posting a message to a MessagePort it owned.</p>
3 <pre id=log></pre>
4 <script>
5 function gc()
7 if (window.GCController)
8 return GCController.collect();
10 for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
11 var s = new String("abc");
15 function log(message)
17 document.getElementById("log").innerHTML += message + "<br>";
20 if (window.testRunner) {
21 testRunner.dumpAsText();
22 testRunner.waitUntilDone();
25 var mainPort;
26 var frameDoc;
28 function test()
30 frameDoc = window.frames[0].document;
31 var channel = new MessageChannel;
32 window.frames[0].postMessage("msg", [channel.port2], "*");
33 mainPort = channel.port1;
34 mainPort.start();
36 mainPort.postMessage("ping");
37 mainPort.onmessage = test2;
40 function test2()
42 var frameElement = document.getElementsByTagName("iframe")[0];
43 frameElement.parentNode.removeChild(frameElement);
44 frameElement = null;
46 gc();
47 setTimeout(test3, 10);
50 function test3()
52 gc();
53 mainPort.postMessage("ping");
54 mainPort.onmessage = function(evt) {
55 if (evt.data == "pong")
56 log("Unexpected response: FAIL");
58 setTimeout(test4, 10);
61 function test4()
63 log("Didn't crash: SUCCESS");
65 if (window.testRunner)
66 testRunner.notifyDone();
69 </script>
70 <iframe src="resources/message-port-iframe.html" onload="test()"></iframe>
71 </body>