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="../../http/tests/inspector/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function initialize_TimelineCoalescing() | 7 function initialize_TimelineCoalescing() |
8 { | 8 { |
9 | 9 |
10 InspectorTest.dumpStats = function(presentationRecord) | 10 InspectorTest.dumpStats = function(presentationRecord) |
11 { | 11 { |
12 if (!presentationRecord.presentationParent()) | 12 if (!presentationRecord.presentationParent()) |
13 return ""; | 13 return ""; |
14 | 14 |
| 15 var model = InspectorTest.timelineModel(); |
15 var aggregatedStats = {}; | 16 var aggregatedStats = {}; |
16 if (presentationRecord.coalesced()) { | 17 if (presentationRecord.coalesced()) { |
17 var presentationChildren = presentationRecord.presentationChildren(); | 18 var presentationChildren = presentationRecord.presentationChildren(); |
18 for (var i = 0; i < presentationChildren.length; ++i) | 19 for (var i = 0; i < presentationChildren.length; ++i) |
19 WebInspector.TimelineUIUtils.aggregateTimeForRecord(aggregatedStats,
presentationChildren[i].record()); | 20 WebInspector.TimelineUIUtils.aggregateTimeForRecord(aggregatedStats,
model, presentationChildren[i].record()); |
20 } else { | 21 } else { |
21 WebInspector.TimelineUIUtils.aggregateTimeForRecord(aggregatedStats, pre
sentationRecord.record()); | 22 WebInspector.TimelineUIUtils.aggregateTimeForRecord(aggregatedStats, mod
el, presentationRecord.record()); |
22 } | 23 } |
23 | 24 |
24 var timeByCategory = ""; | 25 var timeByCategory = ""; |
25 | 26 |
26 for (category in aggregatedStats) { | 27 for (category in aggregatedStats) { |
27 if (timeByCategory) | 28 if (timeByCategory) |
28 timeByCategory += ", "; | 29 timeByCategory += ", "; |
29 timeByCategory += category + ": " + aggregatedStats[category].toFixed(5)
; | 30 timeByCategory += category + ": " + aggregatedStats[category].toFixed(5)
; |
30 } | 31 } |
31 var duration = (presentationRecord.endTime() - presentationRecord.startTime(
)).toFixed(5); | 32 var duration = (presentationRecord.endTime() - presentationRecord.startTime(
)).toFixed(5); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 </script> | 131 </script> |
131 </head> | 132 </head> |
132 | 133 |
133 <body onload="runTest()"> | 134 <body onload="runTest()"> |
134 <p> | 135 <p> |
135 Test timeline records coalescing | 136 Test timeline records coalescing |
136 </p> | 137 </p> |
137 | 138 |
138 </body> | 139 </body> |
139 </html> | 140 </html> |
OLD | NEW |