| 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 test() | 7 function test() |
| 8 { | 8 { |
| 9 var sessionId = "6.23"; | 9 var sessionId = "6.23"; |
| 10 var rawTraceEvents = [ | 10 var rawTraceEvents = [ |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 "cat": "disabled-by-default-devtools.timeline", | 586 "cat": "disabled-by-default-devtools.timeline", |
| 587 "name": "Program", | 587 "name": "Program", |
| 588 "ph": "E", | 588 "ph": "E", |
| 589 "pid": 17851, | 589 "pid": 17851, |
| 590 "tid": 23, | 590 "tid": 23, |
| 591 "ts": 500000, | 591 "ts": 500000, |
| 592 "tts": 5612506 | 592 "tts": 5612506 |
| 593 } | 593 } |
| 594 ]; | 594 ]; |
| 595 | 595 |
| 596 var timeline = WebInspector.panels.timeline; | 596 var timeline = UI.panels.timeline; |
| 597 InspectorTest.setTraceEvents(InspectorTest.timelineModel(), InspectorTest.tr
acingModel(), rawTraceEvents); | 597 InspectorTest.setTraceEvents(InspectorTest.timelineModel(), InspectorTest.tr
acingModel(), rawTraceEvents); |
| 598 | 598 |
| 599 timeline.requestWindowTimes(0, Infinity); | 599 timeline.requestWindowTimes(0, Infinity); |
| 600 var groupByEnum = WebInspector.AggregatedTimelineTreeView.GroupBy; | 600 var groupByEnum = Timeline.AggregatedTimelineTreeView.GroupBy; |
| 601 for (var grouping in groupByEnum) { | 601 for (var grouping in groupByEnum) { |
| 602 var groupingValue = groupByEnum[grouping]; | 602 var groupingValue = groupByEnum[grouping]; |
| 603 testEventTree(WebInspector.TimelinePanel.DetailsTab.CallTree, groupingVa
lue); | 603 testEventTree(Timeline.TimelinePanel.DetailsTab.CallTree, groupingValue)
; |
| 604 testEventTree(WebInspector.TimelinePanel.DetailsTab.BottomUp, groupingVa
lue); | 604 testEventTree(Timeline.TimelinePanel.DetailsTab.BottomUp, groupingValue)
; |
| 605 } | 605 } |
| 606 | 606 |
| 607 testEventTree(WebInspector.TimelinePanel.DetailsTab.Events); | 607 testEventTree(Timeline.TimelinePanel.DetailsTab.Events); |
| 608 InspectorTest.completeTest(); | 608 InspectorTest.completeTest(); |
| 609 | 609 |
| 610 function testEventTree(type, grouping) | 610 function testEventTree(type, grouping) |
| 611 { | 611 { |
| 612 InspectorTest.addResult(""); | 612 InspectorTest.addResult(""); |
| 613 timeline._detailsView.selectTab(type, true); | 613 timeline._detailsView.selectTab(type, true); |
| 614 var callTree = timeline._detailsView._rangeDetailViews.get(type); | 614 var callTree = timeline._detailsView._rangeDetailViews.get(type); |
| 615 if (grouping) { | 615 if (grouping) { |
| 616 InspectorTest.addResult(type + " Group by: " + grouping); | 616 InspectorTest.addResult(type + " Group by: " + grouping); |
| 617 callTree._groupByCombobox.select(callTree._groupByCombobox.options()
.find((x) => x.value === grouping)); | 617 callTree._groupByCombobox.select(callTree._groupByCombobox.options()
.find((x) => x.value === grouping)); |
| 618 callTree._onGroupByChanged(); | 618 callTree._onGroupByChanged(); |
| 619 } else { | 619 } else { |
| 620 InspectorTest.addResult(type); | 620 InspectorTest.addResult(type); |
| 621 } | 621 } |
| 622 var rootNode = callTree._dataGrid.rootNode(); | 622 var rootNode = callTree._dataGrid.rootNode(); |
| 623 for (var node of rootNode.children) | 623 for (var node of rootNode.children) |
| 624 printEventTree(1, node._profileNode, node._treeView); | 624 printEventTree(1, node._profileNode, node._treeView); |
| 625 } | 625 } |
| 626 | 626 |
| 627 function printEventTree(padding, node, treeView) | 627 function printEventTree(padding, node, treeView) |
| 628 { | 628 { |
| 629 var name; | 629 var name; |
| 630 if (node.isGroupNode()) { | 630 if (node.isGroupNode()) { |
| 631 name = treeView._displayInfoForGroupNode(node).name; | 631 name = treeView._displayInfoForGroupNode(node).name; |
| 632 } else { | 632 } else { |
| 633 name = node.event.name === WebInspector.TimelineModel.RecordType.JSFr
ame | 633 name = node.event.name === TimelineModel.TimelineModel.RecordType.JSF
rame |
| 634 ? WebInspector.beautifyFunctionName(node.event.args["data"
]["functionName"]) | 634 ? UI.beautifyFunctionName(node.event.args["data"]["functio
nName"]) |
| 635 : WebInspector.TimelineUIUtils.eventTitle(node.event); | 635 : Timeline.TimelineUIUtils.eventTitle(node.event); |
| 636 } | 636 } |
| 637 InspectorTest.addResult(" ".repeat(padding) + `${name}: ${node.selfTime
.toFixed(3)} ${node.totalTime.toFixed(3)}`); | 637 InspectorTest.addResult(" ".repeat(padding) + `${name}: ${node.selfTime
.toFixed(3)} ${node.totalTime.toFixed(3)}`); |
| 638 (node.children || new Map()).forEach(printEventTree.bind(null, padding +
1)); | 638 (node.children || new Map()).forEach(printEventTree.bind(null, padding +
1)); |
| 639 } | 639 } |
| 640 } | 640 } |
| 641 | 641 |
| 642 </script> | 642 </script> |
| 643 </head> | 643 </head> |
| 644 <body onload="runTest()"> | 644 <body onload="runTest()"> |
| 645 </body> | 645 </body> |
| 646 </html> | 646 </html> |
| OLD | NEW |