Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / message-port-gc-closed-cloned.html
blob8aadb6ae96bdb6ccd690ec670a1898996618f9d1
1 <!DOCTYPE html>
2 <body>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 jsTestIsAsync = true;
6 description("MessagePorts (and their execution contexts) should be collected by GC once close() has been called on them");
7 function runTest() {
8 var channel = new MessageChannel();
9 var port = channel.port1;
10 port.onmessage = function() {
11 iframeDocGC = internals.observeGC(document.querySelector('iframe').contentDocument);
12 document.querySelector('iframe').remove();
13 gc();
14 shouldBeTrue("iframeDocGC.wasCollected");
15 finishJSTest();
17 window.frames[0].postMessage("connect", "*", [channel.port2]);
19 </script>
20 <iframe src="resources/message-port-gc-closed-cloned-iframe.html" onload="runTest()"></iframe>
21 </body>