blob: 5278419d1c6ca2de836f1685865af7f1efdb06f6 [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="heap-snapshot-test.js"></script>
<script>
function test()
{
var instanceCount = 25;
function createHeapSnapshot()
{
return InspectorTest.createHeapSnapshot(instanceCount);
}
InspectorTest.runHeapSnapshotTestSuite([
function testExpansionPreservedWhenSorting(next)
{
InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1);
function step1()
{
InspectorTest.switchToView("Dominators", step2);
}
var columns;
function step2()
{
columns = InspectorTest.viewColumns();
InspectorTest.clickColumn(columns[0], step3);
}
function step3()
{
InspectorTest.findAndExpandWindow(step4);
}
function step4(row)
{
var buttonsNode = InspectorTest.findButtonsNode(row);
InspectorTest.assertEquals(true, !!buttonsNode, "no buttons node found!");
InspectorTest.clickShowMoreButton("showAll", buttonsNode, step5);
}
function step5(row)
{
var row = row.children[0];
InspectorTest.assertEquals(true, !!row, "\"B\" instance row");
InspectorTest.expandRow(row, step6);
}
var columnContents;
function step6()
{
columnContents = InspectorTest.columnContents(columns[0]);
InspectorTest.clickColumn(columns[0], clickTwice);
function clickTwice()
{
InspectorTest.clickColumn(columns[0], step7);
}
}
function step7()
{
var newColumnContents = InspectorTest.columnContents(columns[0]);
InspectorTest.assertColumnContentsEqual(columnContents, newColumnContents);
setTimeout(next, 0);
}
}
]);
}
</script>
</head>
<body onload="runTest()">
<p>
Tests Dominators view of detailed heap snapshots.
Expanded nodes must be preserved after sorting.
</p>
</body>
</html>