3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"heap-snapshot-test.js"></script>
9 var instanceCount
= 25;
10 function createHeapSnapshot()
12 return InspectorTest
.createHeapSnapshot(instanceCount
);
15 InspectorTest
.runHeapSnapshotTestSuite([
16 function testSorting(next
)
18 InspectorTest
.takeAndOpenSnapshot(createHeapSnapshot
, step1
);
22 InspectorTest
.switchToView("Containment", step2
);
28 var currentColumnOrder
;
32 InspectorTest
.findAndExpandGCRoots(step3
);
35 function step3(gcRootsRow
)
38 columns
= InspectorTest
.viewColumns();
40 currentColumnOrder
= false;
46 if (currentColumn
>= columns
.length
) {
51 InspectorTest
.clickColumn(columns
[currentColumn
], step5
);
54 function step5(newColumnState
)
56 columns
[currentColumn
] = newColumnState
;
57 var contents
= InspectorTest
.columnContents(columns
[currentColumn
], gcRoots
);
58 InspectorTest
.assertEquals(true, !!contents
.length
, "column contents");
59 var sortTypes
= { object
: "name", distance
: "number", shallowSize
: "size", retainedSize
: "size" };
60 InspectorTest
.assertEquals(true, !!sortTypes
[columns
[currentColumn
].identifier
], "sort by identifier");
61 InspectorTest
.checkArrayIsSorted(contents
, sortTypes
[columns
[currentColumn
].identifier
], columns
[currentColumn
].sort
);
63 if (!currentColumnOrder
)
64 currentColumnOrder
= true;
66 currentColumnOrder
= false;
77 <body onload=
"runTest()">
79 Tests sorting in Containment view of detailed heap snapshots.