Update To 11.40.268.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
9 function runGCAndTest() {
10     gc();
11     shouldBeTrue("iframeDocGC.wasCollected");
12     finishJSTest();
13 }
14
15 window.onmessage = function(evt) {
16     iframeDocGC = internals.observeGC(document.querySelector('iframe').contentDocument);
17     document.querySelector('iframe').remove();
18     // The iframe is reachable via evt.source, and evt is on the
19     // stack. Force a GC upon return from the event handler, so
20     // that it no longer will be in scope and the iframe can
21     // be GCed.
22     setTimeout(runGCAndTest, 0);
23 }
24 </script>
25 <iframe src="resources/message-port-gc-closed-iframe.html"></iframe>
26 </body>