| 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 function test() | 6 function test() |
| 7 { | 7 { |
| 8 var sessionId = "6.23"; | 8 var sessionId = "6.23"; |
| 9 var rawTraceEvents = [ | 9 var rawTraceEvents = [ |
| 10 { | 10 { |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 "cat": "disabled-by-default-devtools.timeline", | 253 "cat": "disabled-by-default-devtools.timeline", |
| 254 "name": "Program", | 254 "name": "Program", |
| 255 "ph": "E", | 255 "ph": "E", |
| 256 "pid": 17851, | 256 "pid": 17851, |
| 257 "tid": 23, | 257 "tid": 23, |
| 258 "ts": 1500000, | 258 "ts": 1500000, |
| 259 }, | 259 }, |
| 260 ]; | 260 ]; |
| 261 | 261 |
| 262 var cpuProfile = { | 262 var cpuProfile = { |
| 263 startTime: 420, | 263 startTime: 420e3, |
| 264 endTime: 430, | 264 endTime: 430e3, |
| 265 nodes: [ | 265 nodes: [ |
| 266 { | 266 { |
| 267 callFrame: { functionName: "(root)" }, | 267 callFrame: { functionName: "(root)" }, |
| 268 id: 1, | 268 id: 1, |
| 269 children: [2] | 269 children: [2] |
| 270 }, | 270 }, |
| 271 { | 271 { |
| 272 callFrame: { functionName: "foo" }, | 272 callFrame: { functionName: "foo" }, |
| 273 id: 2, | 273 id: 2, |
| 274 children: [3, 4] | 274 children: [3, 4] |
| 275 }, | 275 }, |
| 276 { | 276 { |
| 277 callFrame: { functionName: "bar" }, | 277 callFrame: { functionName: "bar" }, |
| 278 id: 3 | 278 id: 3 |
| 279 }, | 279 }, |
| 280 { | 280 { |
| 281 callFrame: { functionName: "baz" }, | 281 callFrame: { functionName: "baz" }, |
| 282 id: 4 | 282 id: 4 |
| 283 } | 283 } |
| 284 ], | 284 ], |
| 285 timestamps: [421000, 422000, 423000, 424000, 425000, 426000, 427000, 428
000, 429000], | 285 timestampDeltas: new Array(9).fill(1000), |
| 286 samples: [2, 2, 3, 3, 3, 4, 4, 2, 2 ] | 286 samples: [2, 2, 3, 3, 3, 4, 4, 2, 2] |
| 287 }; | 287 }; |
| 288 | 288 |
| 289 var timelineController = InspectorTest.timelineController(); | 289 var timelineController = InspectorTest.timelineController(); |
| 290 timelineController._addCpuProfile(WebInspector.targetManager.mainTarget().id
(), null, cpuProfile); | 290 timelineController._addCpuProfile(WebInspector.targetManager.mainTarget().id
(), null, cpuProfile); |
| 291 timelineController.traceEventsCollected(rawTraceEvents); | 291 timelineController.traceEventsCollected(rawTraceEvents); |
| 292 timelineController._allSourcesFinished(); | 292 timelineController._allSourcesFinished(); |
| 293 var events = InspectorTest.timelineModel().inspectedTargetEvents(); | 293 var events = InspectorTest.timelineModel().inspectedTargetEvents(); |
| 294 events.forEach(e => InspectorTest.addResult(e.name + ": " + e.startTime + "
" + (e.selfTime || 0).toFixed(2) + "/" + (e.duration || 0).toFixed(2))); | 294 events.forEach(e => InspectorTest.addResult(`${e.name}: ${e.startTime} ${(e.
selfTime || 0).toFixed(2)}/${(e.duration || 0).toFixed(2)}`)); |
| 295 InspectorTest.completeTest(); | 295 InspectorTest.completeTest(); |
| 296 } | 296 } |
| 297 | 297 |
| 298 </script> | 298 </script> |
| 299 </head> | 299 </head> |
| 300 <body onload="runTest()"> | 300 <body onload="runTest()"> |
| 301 </body> | 301 </body> |
| 302 </html> | 302 </html> |
| 303 | 303 |
| OLD | NEW |