| 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(record) | 10 InspectorTest.dumpStats = function(presentationRecord) |
| 11 { | 11 { |
| 12 if (record.type() === "Root") | 12 if (!presentationRecord.presentationParent()) |
| 13 return ""; | 13 return ""; |
| 14 var aggregatedStats = record.aggregatedStats(); | 14 var aggregatedStats = presentationRecord.presentationAggregatedStats(); |
| 15 var timeByCategory = ""; | 15 var timeByCategory = ""; |
| 16 | 16 |
| 17 for (category in aggregatedStats) { | 17 for (category in aggregatedStats) { |
| 18 if (timeByCategory) | 18 if (timeByCategory) |
| 19 timeByCategory += ", "; | 19 timeByCategory += ", "; |
| 20 timeByCategory += category + ": " + aggregatedStats[category].toFixed(5)
; | 20 timeByCategory += category + ": " + aggregatedStats[category].toFixed(5)
; |
| 21 } | 21 } |
| 22 var duration = (record.endTime() - record.startTime()).toFixed(5); | 22 var duration = (presentationRecord.endTime() - presentationRecord.startTime(
)).toFixed(5); |
| 23 var durationTillLastChild = (record.endTime() - record.startTime()).toFixed(
5); | 23 var durationTillLastChild = (presentationRecord.endTime() - presentationReco
rd.startTime()).toFixed(5); |
| 24 return "duration: " + duration + ":" + durationTillLastChild + (timeByCatego
ry ? " (" + timeByCategory + ")" : ""); | 24 return "duration: " + duration + ":" + durationTillLastChild + (timeByCatego
ry ? " (" + timeByCategory + ")" : ""); |
| 25 } | 25 } |
| 26 | 26 |
| 27 } | 27 } |
| 28 | 28 |
| 29 function test() | 29 function test() |
| 30 { | 30 { |
| 31 var records = [ | 31 var records = [ |
| 32 // Assure we coalesce records with sort interval and don't coalesce reco
rds that stand apart. | 32 // Assure we coalesce records with sort interval and don't coalesce reco
rds that stand apart. |
| 33 {"startTime": 1000.000,"data":{},"endTime":1099.999,"type":"Program","ch
ildren":[ | 33 {"startTime": 1000.000,"data":{},"endTime":1099.999,"type":"Program","ch
ildren":[ |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 </script> | 94 </script> |
| 95 </head> | 95 </head> |
| 96 | 96 |
| 97 <body onload="runTest()"> | 97 <body onload="runTest()"> |
| 98 <p> | 98 <p> |
| 99 Test timeline records coalescing | 99 Test timeline records coalescing |
| 100 </p> | 100 </p> |
| 101 | 101 |
| 102 </body> | 102 </body> |
| 103 </html> | 103 </html> |
| OLD | NEW |