OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="heap-snapshot-test.js"></script> | 4 <script src="heap-snapshot-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function test() | 7 function test() |
8 { | 8 { |
9 var instanceCount = 25; | 9 var instanceCount = 25; |
10 function createHeapSnapshot() | 10 function createHeapSnapshot() |
11 { | 11 { |
12 return InspectorTest.createHeapSnapshot(instanceCount); | 12 return InspectorTest.createHeapSnapshot(instanceCount); |
13 } | 13 } |
14 | 14 |
15 InspectorTest.runHeapSnapshotTestSuite([ | 15 InspectorTest.runHeapSnapshotTestSuite([ |
16 function testExpansionPreservedWhenSorting(next) | 16 function testExpansionPreservedWhenSorting(next) |
17 { | 17 { |
18 InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1); | 18 InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1); |
19 | 19 |
20 function step1() | 20 function step1() |
21 { | 21 { |
22 InspectorTest.switchToView("Summary", step2); | 22 InspectorTest.switchToView("Summary", step2); |
23 } | 23 } |
24 | 24 |
25 function step2() | 25 function step2() |
26 { | 26 { |
27 var row = InspectorTest.findRow("object", "B"); | 27 var row = InspectorTest.findRow("B"); |
28 InspectorTest.assertEquals(true, !!row, "\"B\" row"); | 28 InspectorTest.assertEquals(true, !!row, "\"B\" row"); |
29 InspectorTest.expandRow(row, expandB); | 29 InspectorTest.expandRow(row, expandB); |
30 function expandB() | 30 function expandB() |
31 { | 31 { |
32 var buttonsNode = InspectorTest.findButtonsNode(row); | 32 var buttonsNode = InspectorTest.findButtonsNode(row); |
33 InspectorTest.assertEquals(true, !!buttonsNode, "no buttons
node found!"); | 33 InspectorTest.assertEquals(true, !!buttonsNode, "no buttons
node found!"); |
34 InspectorTest.clickShowMoreButton("showAll", buttonsNode, st
ep3); | 34 InspectorTest.clickShowMoreButton("showAll", buttonsNode, st
ep3); |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 var columns; | 38 var columns; |
39 function step3() | 39 function step3() |
40 { | 40 { |
41 columns = InspectorTest.viewColumns(); | 41 columns = InspectorTest.viewColumns(); |
42 InspectorTest.clickColumn(columns[0], step4); | 42 InspectorTest.clickColumn(columns[0], step4); |
43 } | 43 } |
44 | 44 |
45 function step4() | 45 function step4() |
46 { | 46 { |
47 var row = InspectorTest.findRow("object", "B"); | 47 var row = InspectorTest.findRow("B"); |
48 InspectorTest.assertEquals(true, !!row, "\"B\" row"); | 48 InspectorTest.assertEquals(true, !!row, "\"B\" row"); |
49 var bInstanceRow = row.children[0]; | 49 var bInstanceRow = row.children[0]; |
50 InspectorTest.assertEquals(true, !!bInstanceRow, "\"B\" instance
row"); | 50 InspectorTest.assertEquals(true, !!bInstanceRow, "\"B\" instance
row"); |
51 InspectorTest.expandRow(bInstanceRow, expandA); | 51 InspectorTest.expandRow(bInstanceRow, expandA); |
52 function expandA(row) | 52 function expandA(row) |
53 { | 53 { |
54 function propertyMatcher(data) | 54 function propertyMatcher(data) |
55 { | 55 { |
56 return data.name === "a" && data.value.charAt(0) === "A"
; | 56 return data._referenceName === "a" && data._name.charAt(
0) === "A"; |
57 } | 57 } |
58 var aRow = InspectorTest.findRow("object", propertyMatcher,
row); | 58 var aRow = InspectorTest.findMatchingRow(propertyMatcher, ro
w); |
59 InspectorTest.assertEquals(true, !!aRow, "\"a: A\" row"); | 59 InspectorTest.assertEquals(true, !!aRow, "\"a: A\" row"); |
60 InspectorTest.expandRow(aRow, step5); | 60 InspectorTest.expandRow(aRow, step5); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 var columnContents; | 64 var columnContents; |
65 function step5() | 65 function step5() |
66 { | 66 { |
67 columnContents = InspectorTest.columnContents(columns[0]); | 67 columnContents = InspectorTest.columnContents(columns[0]); |
68 InspectorTest.clickColumn(columns[0], clickTwice); | 68 InspectorTest.clickColumn(columns[0], clickTwice); |
(...skipping 15 matching lines...) Expand all Loading... |
84 | 84 |
85 </script> | 85 </script> |
86 </head> | 86 </head> |
87 <body onload="runTest()"> | 87 <body onload="runTest()"> |
88 <p> | 88 <p> |
89 Tests Summary view of detailed heap snapshots. | 89 Tests Summary view of detailed heap snapshots. |
90 Expanded nodes must be preserved after sorting. | 90 Expanded nodes must be preserved after sorting. |
91 </p> | 91 </p> |
92 </body> | 92 </body> |
93 </html> | 93 </html> |
OLD | NEW |