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() |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 InspectorTest.switchToView("Containment", step2); | 98 InspectorTest.switchToView("Containment", step2); |
99 } | 99 } |
100 | 100 |
101 function step2() | 101 function step2() |
102 { | 102 { |
103 InspectorTest.findAndExpandGCRoots(step3); | 103 InspectorTest.findAndExpandGCRoots(step3); |
104 } | 104 } |
105 | 105 |
106 function step3(row) | 106 function step3(row) |
107 { | 107 { |
108 InspectorTest.assertEquals("(GC roots)", row.data.object.value,
"(GC roots) object"); | 108 InspectorTest.assertEquals("(GC roots)", row._name, "(GC roots)
object"); |
109 InspectorTest.assertEquals(0, row.data.distance, "(GC roots) dis
tance should be zero"); | 109 InspectorTest.assertEquals(0, row._distance, "(GC roots) distanc
e should be zero"); |
110 InspectorTest.findAndExpandWindow(step4); | 110 InspectorTest.findAndExpandWindow(step4); |
111 } | 111 } |
112 | 112 |
113 function step4(row) | 113 function step4(row) |
114 { | 114 { |
115 InspectorTest.assertEquals("Window", row.data.object.value, "Win
dow object"); | 115 InspectorTest.assertEquals("Window", row._name, "Window object")
; |
116 InspectorTest.assertEquals(distance, row.data.distance, "Window
distance should be 1"); | 116 InspectorTest.assertEquals(distance, row._distance, "Window dist
ance should be 1"); |
117 var child = InspectorTest.findRow("object", function (obj) { ret
urn obj.name === "next"; }, row); | 117 var child = InspectorTest.findMatchingRow(function (obj) { retur
n obj._referenceName === "next"; }, row); |
118 InspectorTest.assertEquals(true, !!child, "next found"); | 118 InspectorTest.assertEquals(true, !!child, "next found"); |
119 InspectorTest.expandRow(child, step5); | 119 InspectorTest.expandRow(child, step5); |
120 } | 120 } |
121 | 121 |
122 function step5(row) | 122 function step5(row) |
123 { | 123 { |
124 ++distance; | 124 ++distance; |
125 InspectorTest.assertEquals(distance, row.data.distance, "Check d
istance of objects chain"); | 125 InspectorTest.assertEquals(distance, row._distance, "Check dista
nce of objects chain"); |
126 if (row.data.object.value === "Tail") { | 126 if (row._name === "Tail") { |
127 InspectorTest.assertEquals(7, distance, "Tail distance"); | 127 InspectorTest.assertEquals(7, distance, "Tail distance"); |
128 setTimeout(next, 0); | 128 setTimeout(next, 0); |
129 return; | 129 return; |
130 } | 130 } |
131 InspectorTest.assertEquals("Body", row.data.object.value, "Body"
); | 131 InspectorTest.assertEquals("Body", row._name, "Body"); |
132 var child = InspectorTest.findRow("object", function (obj) { ret
urn obj.name === "next"; }, row); | 132 var child = InspectorTest.findMatchingRow(function (obj) { retur
n obj._referenceName === "next"; }, row); |
133 InspectorTest.assertEquals(true, !!child, "next found"); | 133 InspectorTest.assertEquals(true, !!child, "next found"); |
134 if (child.data.object.value !== "Tail") | 134 if (child._name !== "Tail") |
135 InspectorTest.expandRow(child, step5); | 135 InspectorTest.expandRow(child, step5); |
136 else | 136 else |
137 step5(child); | 137 step5(child); |
138 } | 138 } |
139 } | 139 } |
140 ]); | 140 ]); |
141 } | 141 } |
142 | 142 |
143 </script> | 143 </script> |
144 </head> | 144 </head> |
145 <body onload="runTest()"> | 145 <body onload="runTest()"> |
146 <p> | 146 <p> |
147 Tests Containment view of detailed heap snapshots. | 147 Tests Containment view of detailed heap snapshots. |
148 The "Show All" button must show all nodes. | 148 The "Show All" button must show all nodes. |
149 Test object distances calculation. | 149 Test object distances calculation. |
150 </p> | 150 </p> |
151 </body> | 151 </body> |
152 </html> | 152 </html> |
OLD | NEW |