Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / dom / node-iterator-document-moved-crash.html
1 <html>
2     <head>
3         <script>
4             if (window.testRunner) {
5                 testRunner.dumpAsText();
6                 testRunner.waitUntilDone();
7             }
8             
9             function gc()
10             {
11                 if (window.GCController)
12                     return GCController.collect();
13
14                 for (var i = 0; i < 10000; i++) { // force garbage collection (FF requires about 9K allocations before a collect).
15                     var s = new String("abc");
16                 }
17             }
18             
19             function runTest()
20             {
21                 aElement = document.createElement('a');
22                 divElement = document.createElement('div');
23                 document.body.appendChild(divElement);
24                 nodeIterator = win.document.createNodeIterator(aElement);
25                 win.document.body.appendChild(aElement);
26
27                 delete nodeIterator;
28                 gc();
29                 document.body.removeChild(divElement);
30                 gc();
31                 
32                 if (window.testRunner)
33                     testRunner.notifyDone();
34             }
35         </script>
36     </head>
37     <body>
38         <iframe onload="this.onload = null; win = this.contentWindow; runTest();"></iframe>
39         Test passes if it does not crash.
40     </body>
41 </html>
42