Upstream version 9.37.197.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / profiler / heap-snapshot-reveal-in-dominators-view.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     var instanceCount = 25;
10     function createHeapSnapshot()
11     {
12         return InspectorTest.createHeapSnapshot(instanceCount);
13     }
14
15     InspectorTest.runHeapSnapshotTestSuite([
16         function testShowAll(next)
17         {
18             InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1);
19             var nodeAHeapSnapshotObjectId = 5 + 2*15 ; // Id of the 16th A node.
20
21             function step1()
22             {
23                 InspectorTest.addSniffer(WebInspector.HeapSnapshotDominatorsDataGrid.prototype, "highlightNode", didHighlightNode);
24                 WebInspector.panels.profiles.showObject(nodeAHeapSnapshotObjectId, "Dominators");
25                 InspectorTest.addResult("Revealing node...");
26             }
27
28             function didHighlightNode(node)
29             {
30                 InspectorTest.assertEquals(nodeAHeapSnapshotObjectId, node.snapshotNodeId, "Unxpected node highlighted.");
31                 InspectorTest.addResult("Node revealed.");
32                 next();
33             }
34         }
35     ]);
36 }
37
38 </script>
39 </head>
40 <body onload="runTest()">
41 <p>
42 Tests that an object can be revealed in the Dominators view of detailed heap snapshots.
43 </p>
44 </body>
45 </html>