3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"heap-snapshot-test.js"></script>
9 var instanceCount
= 24;
10 function createHeapSnapshotA()
12 return InspectorTest
.createHeapSnapshot(instanceCount
, 5);
14 function createHeapSnapshotB()
16 return InspectorTest
.createHeapSnapshot(instanceCount
+ 1, 5 + instanceCount
);
19 InspectorTest
.runHeapSnapshotTestSuite([
20 function testExpansionPreservedWhenSorting(next
)
22 InspectorTest
.takeAndOpenSnapshot(createHeapSnapshotA
, createSnapshotB
);
23 function createSnapshotB() {
24 InspectorTest
.takeAndOpenSnapshot(createHeapSnapshotB
, step1
);
29 InspectorTest
.switchToView("Comparison", step2
);
35 columns
= InspectorTest
.viewColumns();
36 InspectorTest
.clickColumn(columns
[0], step3
);
41 var row
= InspectorTest
.findRow("B");
42 InspectorTest
.assertEquals(true, !!row
, "\"B\" row");
43 InspectorTest
.expandRow(row
, showNext
);
44 function showNext(row
)
46 var buttonsNode
= InspectorTest
.findButtonsNode(row
);
47 InspectorTest
.assertEquals(true, !!buttonsNode
, "no buttons node found!");
48 InspectorTest
.clickShowMoreButton("showAll", buttonsNode
, step4
);
54 var row
= InspectorTest
.findRow("B");
55 InspectorTest
.assertEquals(true, !!row
, "\"B\" row");
56 function deletedNodeMatcher(data
)
58 return data
._isDeletedNode
&& data
._name
.charAt(0) === "B";
60 var bInstanceRow
= InspectorTest
.findMatchingRow(deletedNodeMatcher
, row
);
61 InspectorTest
.assertEquals(true, !!bInstanceRow
, "\"B\" instance row");
62 var buttonsNode
= InspectorTest
.findButtonsNode(row
, bInstanceRow
);
63 InspectorTest
.assertEquals(false, !!buttonsNode
, "buttons node found!");
70 nodeCount
= InspectorTest
.columnContents(columns
[0]).length
;
71 InspectorTest
.assertEquals(true, nodeCount
> 0, "nodeCount > 0");
73 InspectorTest
.clickColumn(columns
[0], clickTwice
);
76 InspectorTest
.clickColumn(columns
[0], step6
);
82 var newNodeCount
= InspectorTest
.columnContents(columns
[0]).length
;
83 InspectorTest
.assertEquals(nodeCount
, newNodeCount
);
92 <body onload=
"runTest()">
94 Tests Comparison view of detailed heap snapshots.
95 Shown node count must be preserved after sorting.