[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / message-channel-listener-circular-ownership.html
1 <body>
2 <p>Test that a leak is not created by assigning a MessagePort to a property of its own listener.</p>
3 <p>Only works with run-webkit-tests --leaks.</p>
4 <pre id=log></pre>
5 <script>
6 function gc()
7 {
8     if (window.GCController)
9         return GCController.collect();
10
11     for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
12         var s = new String("abc");
13     }
14 }
15
16 if (window.layoutTestController)
17     layoutTestController.dumpAsText();
18
19 var channel = new MessageChannel;
20
21 channel.port1.onclose = function() {}
22
23 channel.port1.onclose.foo = channel;
24 channel.port1.onclose.bar = channel.port1;
25 channel.port1.onclose.baz = channel.port2;
26
27 channel = null;
28 gc();
29 </script>
30 </body>