| <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 testShownNodeCountPreservedWhenSorting(next) |
| { |
| InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1); |
| |
| function step1() |
| { |
| InspectorTest.switchToView("Containment", 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("showNext", buttonsNode, step5); |
| } |
| |
| var nodeCount; |
| function step5(row) |
| { |
| // There must be enough nodes to have some unrevealed. |
| var buttonsNode = InspectorTest.findButtonsNode(row); |
| InspectorTest.assertEquals(true, !!buttonsNode, "no buttons node found!"); |
| |
| nodeCount = InspectorTest.columnContents(columns[0]).length; |
| InspectorTest.assertEquals(true, nodeCount > 0, "nodeCount > 0"); |
| |
| InspectorTest.clickColumn(columns[0], clickTwice); |
| function clickTwice() |
| { |
| InspectorTest.clickColumn(columns[0], step6); |
| } |
| } |
| |
| function step6() |
| { |
| var newNodeCount = InspectorTest.columnContents(columns[0]).length; |
| InspectorTest.assertEquals(nodeCount, newNodeCount); |
| setTimeout(next, 0); |
| } |
| } |
| ]); |
| } |
| |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p> |
| Tests Containment view of detailed heap snapshots. |
| Shown node count must be preserved after sorting. |
| </p> |
| </body> |
| </html> |