| <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 testShowNext(next) |
| { |
| InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1); |
| |
| function step1() |
| { |
| InspectorTest.switchToView("Dominators", step2); |
| } |
| |
| function step2() |
| { |
| InspectorTest.findAndExpandRow("Window", step3); |
| } |
| |
| function step3(row) |
| { |
| var rowsShown = InspectorTest.countDataRows(row); |
| InspectorTest.assertEquals(true, rowsShown <= instanceCount, "shown more instances than created: " + rowsShown + " > " + instanceCount); |
| if (rowsShown < instanceCount) { |
| var buttonsNode = InspectorTest.findButtonsNode(row); |
| InspectorTest.assertEquals(true, !!buttonsNode, "buttons node"); |
| InspectorTest.clickShowMoreButton("showNext", buttonsNode, step3); |
| } else if (rowsShown === instanceCount) { |
| var buttonsNode = InspectorTest.findButtonsNode(row); |
| InspectorTest.assertEquals(false, !!buttonsNode, "buttons node found when all instances are shown!"); |
| setTimeout(next, 0); |
| } |
| } |
| } |
| ]); |
| } |
| |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <p> |
| Tests Dominators view of detailed heap snapshots. |
| Repeated clicks on "Show Next" button must show all nodes. |
| </p> |
| </body> |
| </html> |