Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / events / message-port-gc-closed.html
1 <!DOCTYPE html>
2 <body>
3 <script src="../../resources/js-test.js"></script>
4 <script>
5 description("MessagePorts (and their execution contexts) should be collected by GC once close() has been called on them");
6
7 window.jsTestIsAsync = true;
8 window.onmessage = function(evt) {
9     iframeDocGC = internals.observeGC(document.querySelector('iframe').contentDocument);
10     document.querySelector('iframe').remove();
11     // The iframe is reachable via evt.source, and evt is on the
12     // stack. asyncGC() will invoke the callback once back at
13     // the event loop (and after having forced a GC); evt
14     // will consequently no longer be in scope and the iframe
15     // will have been GCed.
16     asyncGC(function () {
17         shouldBeTrue("iframeDocGC.wasCollected");
18         finishJSTest();
19     });
20 }
21 </script>
22 <iframe src="resources/message-port-gc-closed-iframe.html"></iframe>
23 </body>