3 <script src=
"../../resources/js-test.js"></script>
6 description("MessagePorts (and their execution contexts) should be collected by GC once close() has been called on them");
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();
14 shouldBeTrue("iframeDocGC.wasCollected");
17 window
.frames
[0].postMessage("connect", "*", [channel
.port2
]);
20 <iframe src=
"resources/message-port-gc-closed-cloned-iframe.html" onload=
"runTest()"></iframe>