| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="heap-snapshot-test.js"></script> | |
| 5 <script> | |
| 6 | |
| 7 function test() | |
| 8 { | |
| 9 var instanceCount = 25; | |
| 10 function createHeapSnapshot() | |
| 11 { | |
| 12 return InspectorTest.createHeapSnapshot(instanceCount); | |
| 13 } | |
| 14 | |
| 15 InspectorTest.runHeapSnapshotTestSuite([ | |
| 16 function testShowAll(next) | |
| 17 { | |
| 18 InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1); | |
| 19 | |
| 20 function step1() | |
| 21 { | |
| 22 InspectorTest.switchToView("Dominators", step2); | |
| 23 } | |
| 24 | |
| 25 function step2() | |
| 26 { | |
| 27 InspectorTest.findAndExpandWindow(step3); | |
| 28 } | |
| 29 | |
| 30 function step3(row) | |
| 31 { | |
| 32 var buttonsNode = InspectorTest.findButtonsNode(row); | |
| 33 InspectorTest.assertEquals(true, !!buttonsNode, "buttons node"); | |
| 34 var words = buttonsNode.showAll.textContent.split(" "); | |
| 35 for (var i = 0; i < words.length; ++i) { | |
| 36 var maybeNumber = parseInt(words[i], 10); | |
| 37 if (!isNaN(maybeNumber)) | |
| 38 InspectorTest.assertEquals(instanceCount - row._dataGrid
.defaultPopulateCount(), maybeNumber, buttonsNode.showAll.textContent); | |
| 39 } | |
| 40 InspectorTest.clickShowMoreButton("showAll", buttonsNode, step4)
; | |
| 41 } | |
| 42 | |
| 43 function step4(row) | |
| 44 { | |
| 45 var rowsShown = InspectorTest.countDataRows(row); | |
| 46 InspectorTest.assertEquals(instanceCount, rowsShown, "after show
All click"); | |
| 47 var buttonsNode = InspectorTest.findButtonsNode(row); | |
| 48 InspectorTest.assertEquals(false, !!buttonsNode, "buttons node f
ound when all instances are shown!"); | |
| 49 setTimeout(next, 0); | |
| 50 } | |
| 51 } | |
| 52 ]); | |
| 53 } | |
| 54 | |
| 55 </script> | |
| 56 </head> | |
| 57 <body onload="runTest()"> | |
| 58 <p> | |
| 59 Tests Dominators view of detailed heap snapshots. | |
| 60 The "Show All" button must show all nodes. | |
| 61 </p> | |
| 62 </body> | |
| 63 </html> | |
| OLD | NEW |