Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / profiler / heap-snapshot-summary-show-ranges.html
1 <html>
2 <head>
3     <script src="../../http/tests/inspector/inspector-test.js"></script>
4     <script src="heap-snapshot-test.js"></script>
5 <script>
6
7 function test()
8 {
9
10     var instanceCount = 50;
11     function createHeapSnapshot()
12     {
13         return InspectorTest.createHeapSnapshot(instanceCount);
14     }
15
16     InspectorTest.runHeapSnapshotTestSuite([
17         function testShowAll(next)
18         {
19             InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1);
20             var row;
21
22             function dumpAndPopulate(step, from, to, callback)
23             {
24                 InspectorTest.addResult("");
25                 InspectorTest.addResult(step);
26                 InspectorTest.addResult("Retrieved ranges: " + JSON.stringify(row._retrievedChildrenRanges));
27                 for (var i = 0; i < row.children.length; ++i)
28                     InspectorTest.addResult("[" + i + "] " + row.children[i]._element.textContent.replace(/[^\w\d]/mg, " "));
29                 if (callback)
30                     row._populateChildren(from, to, callback);
31             }
32
33             function step1()
34             {
35                 InspectorTest.switchToView("Summary", step2);
36             }
37
38             function step2()
39             {
40                 row = InspectorTest.findRow("A");
41                 InspectorTest.addResult("Row found: " + !!row);
42                 InspectorTest.expandRow(row, step3);
43             }
44
45             function step3()
46             {
47                 dumpAndPopulate("Step 3", 30, 40, step4);
48             }
49
50             function step4()
51             {
52                 dumpAndPopulate("Step 4", 20, 25, step5);
53             }
54
55             function step5()
56             {
57                 dumpAndPopulate("Step 5", 28, 35, step6);
58             }
59
60             function step6()
61             {
62                 dumpAndPopulate("Step 6", 18, 26, step7);
63             }
64
65             function step7()
66             {
67                 dumpAndPopulate("Step 7", 15, 45, step8);
68             }
69
70             function step8()
71             {
72                 dumpAndPopulate("Step 8", 10, 15, step9);
73             }
74
75             function step9()
76             {
77                 dumpAndPopulate("Step 9");
78                 setTimeout(next, 0);
79             }
80         }
81     ]);
82 }
83
84 </script>
85 </head>
86 <body onload="runTest()">
87 <p>
88 Tests showing several node ranges in the Summary view of detailed heap snapshot.
89 </p>
90 </body>
91 </html>