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 = 24; | 9 var instanceCount = 24; |
10 function createHeapSnapshotA() | 10 function createHeapSnapshotA() |
(...skipping 13 matching lines...) Expand all Loading... |
24 InspectorTest.takeAndOpenSnapshot(createHeapSnapshotB, step1); | 24 InspectorTest.takeAndOpenSnapshot(createHeapSnapshotB, step1); |
25 } | 25 } |
26 | 26 |
27 function step1() | 27 function step1() |
28 { | 28 { |
29 InspectorTest.switchToView("Comparison", step2); | 29 InspectorTest.switchToView("Comparison", step2); |
30 } | 30 } |
31 | 31 |
32 function step2() | 32 function step2() |
33 { | 33 { |
34 var row = InspectorTest.findRow("object", "B"); | 34 var row = InspectorTest.findRow("B"); |
35 InspectorTest.assertEquals(true, !!row, "\"B\" row"); | 35 InspectorTest.assertEquals(true, !!row, "\"B\" row"); |
36 InspectorTest.expandRow(row, expandB); | 36 InspectorTest.expandRow(row, expandB); |
37 function expandB() | 37 function expandB() |
38 { | 38 { |
39 var buttonsNode = InspectorTest.findButtonsNode(row); | 39 var buttonsNode = InspectorTest.findButtonsNode(row); |
40 InspectorTest.assertEquals(true, !!buttonsNode, "no buttons
node found!"); | 40 InspectorTest.assertEquals(true, !!buttonsNode, "no buttons
node found!"); |
41 InspectorTest.clickShowMoreButton("showAll", buttonsNode, st
ep4); | 41 InspectorTest.clickShowMoreButton("showAll", buttonsNode, st
ep4); |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 var columns; | 45 var columns; |
46 function step4() | 46 function step4() |
47 { | 47 { |
48 columns = InspectorTest.viewColumns(); | 48 columns = InspectorTest.viewColumns(); |
49 InspectorTest.clickColumn(columns[0], step5); | 49 InspectorTest.clickColumn(columns[0], step5); |
50 } | 50 } |
51 | 51 |
52 function step5() | 52 function step5() |
53 { | 53 { |
54 var row = InspectorTest.findRow("object", "B"); | 54 var row = InspectorTest.findRow("B"); |
55 InspectorTest.assertEquals(true, !!row, "\"B\" row"); | 55 InspectorTest.assertEquals(true, !!row, "\"B\" row"); |
56 var bInstanceRow = row.children[0]; | 56 var bInstanceRow = row.children[0]; |
57 InspectorTest.assertEquals(true, !!bInstanceRow, "\"B\" instance
row"); | 57 InspectorTest.assertEquals(true, !!bInstanceRow, "\"B\" instance
row"); |
58 InspectorTest.expandRow(bInstanceRow, expandA); | 58 InspectorTest.expandRow(bInstanceRow, expandA); |
59 function expandA(row) | 59 function expandA(row) |
60 { | 60 { |
61 function propertyMatcher(data) | 61 function propertyMatcher(node) |
62 { | 62 { |
63 return data.name === "a" && data.value.charAt(0) === "A"
; | 63 return node._referenceName === "a" && node._name.charAt(
0) === "A"; |
64 } | 64 } |
65 var aRow = InspectorTest.findRow("object", propertyMatcher,
row); | 65 var aRow = InspectorTest.findMatchingRow(propertyMatcher, ro
w); |
66 InspectorTest.assertEquals(true, !!aRow, "\"a: A\" row"); | 66 InspectorTest.assertEquals(true, !!aRow, "\"a: A\" row"); |
67 InspectorTest.expandRow(aRow, step6); | 67 InspectorTest.expandRow(aRow, step6); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 function step6() | 71 function step6() |
72 { | 72 { |
73 var row = InspectorTest.findRow("object", "B"); | 73 var row = InspectorTest.findRow("B"); |
74 InspectorTest.assertEquals(true, !!row, "\"B\" row"); | 74 InspectorTest.assertEquals(true, !!row, "\"B\" row"); |
75 function deletedNodeMatcher(data) | 75 function deletedNodeMatcher(data) |
76 { | 76 { |
77 return data.removedCount && data.object.value.charAt(0) ===
"B"; | 77 return data._isDeletedNode && data._name.charAt(0) === "B"; |
78 } | 78 } |
79 var bInstanceRow = InspectorTest.findRow2(deletedNodeMatcher, ro
w); | 79 var bInstanceRow = InspectorTest.findMatchingRow(deletedNodeMatc
her, row); |
80 InspectorTest.assertEquals(true, !!bInstanceRow, "\"B\" instance
row"); | 80 InspectorTest.assertEquals(true, !!bInstanceRow, "\"B\" instance
row"); |
81 InspectorTest.expandRow(bInstanceRow, expandA); | 81 InspectorTest.expandRow(bInstanceRow, expandA); |
82 function expandA(row) | 82 function expandA(row) |
83 { | 83 { |
84 function propertyMatcher(data) | 84 function propertyMatcher(data) |
85 { | 85 { |
86 return data.name === "a" && data.value.charAt(0) === "A"
; | 86 return data._referenceName === "a" && data._name.charAt(
0) === "A"; |
87 } | 87 } |
88 var aRow = InspectorTest.findRow("object", propertyMatcher,
row); | 88 var aRow = InspectorTest.findMatchingRow(propertyMatcher, ro
w); |
89 InspectorTest.assertEquals(true, !!aRow, "\"a: A\" row"); | 89 InspectorTest.assertEquals(true, !!aRow, "\"a: A\" row"); |
90 InspectorTest.expandRow(aRow, step7); | 90 InspectorTest.expandRow(aRow, step7); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 var columnContents; | 94 var columnContents; |
95 function step7() | 95 function step7() |
96 { | 96 { |
97 columnContents = InspectorTest.columnContents(columns[0]); | 97 columnContents = InspectorTest.columnContents(columns[0]); |
98 InspectorTest.clickColumn(columns[0], clickTwice); | 98 InspectorTest.clickColumn(columns[0], clickTwice); |
(...skipping 15 matching lines...) Expand all Loading... |
114 | 114 |
115 </script> | 115 </script> |
116 </head> | 116 </head> |
117 <body onload="runTest()"> | 117 <body onload="runTest()"> |
118 <p> | 118 <p> |
119 Tests Comparison view of detailed heap snapshots. | 119 Tests Comparison view of detailed heap snapshots. |
120 Expanded nodes must be preserved after sorting. | 120 Expanded nodes must be preserved after sorting. |
121 </p> | 121 </p> |
122 </body> | 122 </body> |
123 </html> | 123 </html> |
OLD | NEW |