| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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: 420, |
| 264 endTime: 430, | 264 endTime: 430, |
| 265 head: { | 265 nodes: [ |
| 266 callFrame: { functionName: "(root)" }, | 266 { |
| 267 id: 1, | 267 callFrame: { functionName: "(root)" }, |
| 268 children: [{ | 268 id: 1, |
| 269 children: [2] |
| 270 }, |
| 271 { |
| 269 callFrame: { functionName: "foo" }, | 272 callFrame: { functionName: "foo" }, |
| 270 id: 2, | 273 id: 2, |
| 271 children: [{ | 274 children: [3, 4] |
| 272 callFrame: { functionName: "bar" }, | 275 }, |
| 273 id: 3, | 276 { |
| 274 children: [] | 277 callFrame: { functionName: "bar" }, |
| 275 }, | 278 id: 3, |
| 276 { | 279 children: [] |
| 277 callFrame: { functionName: "baz" }, | 280 }, |
| 278 id: 4, | 281 { |
| 279 children: [] | 282 callFrame: { functionName: "baz" }, |
| 280 }] | 283 id: 4, |
| 281 }] | 284 children: [] |
| 282 }, | 285 } |
| 286 ], |
| 283 timestamps: [421000, 422000, 423000, 424000, 425000, 426000, 427000, 428
000, 429000], | 287 timestamps: [421000, 422000, 423000, 424000, 425000, 426000, 427000, 428
000, 429000], |
| 284 samples: [2, 2, 3, 3, 3, 4, 4, 2, 2 ] | 288 samples: [2, 2, 3, 3, 3, 4, 4, 2, 2 ] |
| 285 }; | 289 }; |
| 286 | 290 |
| 287 var timelineController = InspectorTest.timelineController(); | 291 var timelineController = InspectorTest.timelineController(); |
| 288 timelineController._addCpuProfile(WebInspector.targetManager.mainTarget().id
(), null, cpuProfile); | 292 timelineController._addCpuProfile(WebInspector.targetManager.mainTarget().id
(), null, cpuProfile); |
| 289 timelineController.traceEventsCollected(rawTraceEvents); | 293 timelineController.traceEventsCollected(rawTraceEvents); |
| 290 timelineController._allSourcesFinished(); | 294 timelineController._allSourcesFinished(); |
| 291 var events = InspectorTest.timelineModel().inspectedTargetEvents(); | 295 var events = InspectorTest.timelineModel().inspectedTargetEvents(); |
| 292 events.forEach(e => InspectorTest.addResult(e.name + ": " + e.startTime + "
" + (e.selfTime || 0).toFixed(2) + "/" + (e.duration || 0).toFixed(2))); | 296 events.forEach(e => InspectorTest.addResult(e.name + ": " + e.startTime + "
" + (e.selfTime || 0).toFixed(2) + "/" + (e.duration || 0).toFixed(2))); |
| 293 InspectorTest.completeTest(); | 297 InspectorTest.completeTest(); |
| 294 } | 298 } |
| 295 | 299 |
| 296 </script> | 300 </script> |
| 297 </head> | 301 </head> |
| 298 <body onload="runTest()"> | 302 <body onload="runTest()"> |
| 299 </body> | 303 </body> |
| 300 </html> | 304 </html> |
| 301 | 305 |
| OLD | NEW |