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="../tracing-test.js"></script> | 4 <script src="../tracing-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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 events.filter(function(e) { return e.duration; }).forEach(function(e) { | 380 events.filter(function(e) { return e.duration; }).forEach(function(e) { |
381 InspectorTest.addResult(e.name + ": " + e.startTime.toFixed(3) + " / " +
(e.duration.toFixed(3) || 0) + " " + (e.args.data && e.args.data.functionName |
| "")); | 381 InspectorTest.addResult(e.name + ": " + e.startTime.toFixed(3) + " / " +
(e.duration.toFixed(3) || 0) + " " + (e.args.data && e.args.data.functionName |
| "")); |
382 }); | 382 }); |
383 | 383 |
384 InspectorTest.addResult(""); | 384 InspectorTest.addResult(""); |
385 tracingTimelineModel._setMainThreadEvents(events); | 385 tracingTimelineModel._setMainThreadEvents(events); |
386 var filters = [ | 386 var filters = [ |
387 WebInspector.TimelineUIUtils.hiddenEventsFilter(), | 387 WebInspector.TimelineUIUtils.hiddenEventsFilter(), |
388 new WebInspector.ExcludeTopLevelFilter() | 388 new WebInspector.ExcludeTopLevelFilter() |
389 ]; | 389 ]; |
390 var treeTopDown = WebInspector.TimelineUIUtils.buildTopDownTree(events, 0, I
nfinity, filters, eventId); | 390 var treeTopDown = WebInspector.TimelineModel.buildTopDownTree(events, 0, Inf
inity, filters, eventId); |
391 printProfileTree(0, treeTopDown); | 391 printProfileTree(0, treeTopDown); |
392 var treeBottomUp = WebInspector.TimelineUIUtils.buildBottomUpTree(treeTopDow
n); | 392 var treeBottomUp = WebInspector.TimelineModel.buildBottomUpTree(treeTopDown)
; |
393 printProfileTree(0, treeBottomUp); | 393 printProfileTree(0, treeBottomUp); |
394 | 394 |
395 function eventId(event) | 395 function eventId(event) |
396 { | 396 { |
397 var data = event.args.data; | 397 var data = event.args.data; |
398 return data && (data.callUID || data.functionNode); | 398 return data && (data.callUID || data.functionNode); |
399 } | 399 } |
400 | 400 |
401 function printProfileTree(padding, node) | 401 function printProfileTree(padding, node) |
402 { | 402 { |
403 InspectorTest.addResult(" ".repeat(padding) + node.name + ": " + node.t
otalTime.toFixed(3)); | 403 InspectorTest.addResult(" ".repeat(padding) + node.name + ": " + node.t
otalTime.toFixed(3)); |
404 (node.children || new Map()).forEach(printProfileTree.bind(null, padding
+ 1)); | 404 (node.children || new Map()).forEach(printProfileTree.bind(null, padding
+ 1)); |
405 } | 405 } |
406 | 406 |
407 InspectorTest.completeTest(); | 407 InspectorTest.completeTest(); |
408 } | 408 } |
409 | 409 |
410 </script> | 410 </script> |
411 </head> | 411 </head> |
412 <body onload="runTest()"> | 412 <body onload="runTest()"> |
413 </body> | 413 </body> |
414 </html> | 414 </html> |
OLD | NEW |