| 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 async function test() |
| 8 { | 8 { |
| 9 var sessionId = "6.23"; | 9 var sessionId = "6.23"; |
| 10 var rawTraceEvents = [ | 10 var rawTraceEvents = [ |
| 11 { | 11 { |
| 12 "args": { | 12 "args": { |
| 13 "name": "Renderer" | 13 "name": "Renderer" |
| 14 }, | 14 }, |
| 15 "cat": "__metadata", | 15 "cat": "__metadata", |
| 16 "name": "process_name", | 16 "name": "process_name", |
| 17 "ph": "M", | 17 "ph": "M", |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 "name": "JSSample", | 462 "name": "JSSample", |
| 463 "ph": "I", | 463 "ph": "I", |
| 464 "pid": 17851, | 464 "pid": 17851, |
| 465 "tid": 23, | 465 "tid": 23, |
| 466 "ts": 251400 | 466 "ts": 251400 |
| 467 }, | 467 }, |
| 468 { | 468 { |
| 469 "args": { | 469 "args": { |
| 470 "data": { | 470 "data": { |
| 471 "stackTrace": [ | 471 "stackTrace": [ |
| 472 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" }, | 472 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://www.google.com/rec.js" }, |
| 473 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" }, | 473 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://www.google.com/rec.js" }, |
| 474 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" }, | 474 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://www.google.com/rec.js" }, |
| 475 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" } | 475 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://www.google.com/rec.js" } |
| 476 ] | 476 ] |
| 477 } | 477 } |
| 478 }, | 478 }, |
| 479 "cat": "disabled-by-default-devtools.timeline", | 479 "cat": "disabled-by-default-devtools.timeline", |
| 480 "name": "JSSample", | 480 "name": "JSSample", |
| 481 "ph": "I", | 481 "ph": "I", |
| 482 "pid": 17851, | 482 "pid": 17851, |
| 483 "tid": 23, | 483 "tid": 23, |
| 484 "ts": 253000 | 484 "ts": 253000 |
| 485 }, | 485 }, |
| 486 { | 486 { |
| 487 "args": { | 487 "args": { |
| 488 "data": { | 488 "data": { |
| 489 "stackTrace": [ | 489 "stackTrace": [ |
| 490 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" }, | 490 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://www.google.com/rec.js" }, |
| 491 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" }, | 491 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://www.google.com/rec.js" }, |
| 492 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" } | 492 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://www.google.com/rec.js" } |
| 493 ] | 493 ] |
| 494 } | 494 } |
| 495 }, | 495 }, |
| 496 "cat": "disabled-by-default-devtools.timeline", | 496 "cat": "disabled-by-default-devtools.timeline", |
| 497 "name": "JSSample", | 497 "name": "JSSample", |
| 498 "ph": "I", | 498 "ph": "I", |
| 499 "pid": 17851, | 499 "pid": 17851, |
| 500 "tid": 23, | 500 "tid": 23, |
| 501 "ts": 253008 | 501 "ts": 253008 |
| 502 }, | 502 }, |
| 503 { | 503 { |
| 504 "args": { | 504 "args": { |
| 505 "data": { | 505 "data": { |
| 506 "stackTrace": [ | 506 "stackTrace": [ |
| 507 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" }, | 507 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://www.google.com/rec.js" }, |
| 508 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" } | 508 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://www.google.com/rec.js" } |
| 509 ] | 509 ] |
| 510 } | 510 } |
| 511 }, | 511 }, |
| 512 "cat": "disabled-by-default-devtools.timeline", | 512 "cat": "disabled-by-default-devtools.timeline", |
| 513 "name": "JSSample", | 513 "name": "JSSample", |
| 514 "ph": "I", | 514 "ph": "I", |
| 515 "pid": 17851, | 515 "pid": 17851, |
| 516 "tid": 23, | 516 "tid": 23, |
| 517 "ts": 253012 | 517 "ts": 253012 |
| 518 }, | 518 }, |
| 519 { | 519 { |
| 520 "args": { | 520 "args": { |
| 521 "data": { | 521 "data": { |
| 522 "stackTrace": [ | 522 "stackTrace": [ |
| 523 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" } | 523 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://www.google.com/rec.js" } |
| 524 ] | 524 ] |
| 525 } | 525 } |
| 526 }, | 526 }, |
| 527 "cat": "disabled-by-default-devtools.timeline", | 527 "cat": "disabled-by-default-devtools.timeline", |
| 528 "name": "JSSample", | 528 "name": "JSSample", |
| 529 "ph": "I", | 529 "ph": "I", |
| 530 "pid": 17851, | 530 "pid": 17851, |
| 531 "tid": 23, | 531 "tid": 23, |
| 532 "ts": 253014 | 532 "ts": 253014 |
| 533 }, | 533 }, |
| 534 { | 534 { |
| 535 "args": { | 535 "args": { |
| 536 "data": { | 536 "data": { |
| 537 "stackTrace": [ | 537 "stackTrace": [ |
| 538 ] | 538 ] |
| 539 } | 539 } |
| 540 }, | 540 }, |
| 541 "cat": "disabled-by-default-devtools.timeline", | 541 "cat": "disabled-by-default-devtools.timeline", |
| 542 "name": "JSSample", | 542 "name": "JSSample", |
| 543 "ph": "I", | 543 "ph": "I", |
| 544 "pid": 17851, | 544 "pid": 17851, |
| 545 "tid": 23, | 545 "tid": 23, |
| 546 "ts": 253015 | 546 "ts": 253015 |
| 547 }, | 547 }, |
| 548 { | 548 { |
| 549 "args": { | 549 "args": { |
| 550 "data": { | 550 "data": { |
| 551 "stackTrace": [ | 551 "stackTrace": [ |
| 552 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" }, | 552 { "functionName": "recursive_b", "scriptId": 1, "url": "http
://www.google.com/rec.js" }, |
| 553 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" } | 553 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://www.google.com/rec.js" } |
| 554 ] | 554 ] |
| 555 } | 555 } |
| 556 }, | 556 }, |
| 557 "cat": "disabled-by-default-devtools.timeline", | 557 "cat": "disabled-by-default-devtools.timeline", |
| 558 "name": "JSSample", | 558 "name": "JSSample", |
| 559 "ph": "I", | 559 "ph": "I", |
| 560 "pid": 17851, | 560 "pid": 17851, |
| 561 "tid": 23, | 561 "tid": 23, |
| 562 "ts": 253100 | 562 "ts": 253100 |
| 563 }, | 563 }, |
| 564 { | 564 { |
| 565 "args": { | 565 "args": { |
| 566 "data": { | 566 "data": { |
| 567 "stackTrace": [ | 567 "stackTrace": [ |
| 568 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://xyz.abc.com/rec.js" } | 568 { "functionName": "recursive_a", "scriptId": 1, "url": "http
://www.google.com/rec.js" } |
| 569 ] | 569 ] |
| 570 } | 570 } |
| 571 }, | 571 }, |
| 572 "cat": "disabled-by-default-devtools.timeline", | 572 "cat": "disabled-by-default-devtools.timeline", |
| 573 "name": "JSSample", | 573 "name": "JSSample", |
| 574 "ph": "I", | 574 "ph": "I", |
| 575 "pid": 17851, | 575 "pid": 17851, |
| 576 "tid": 23, | 576 "tid": 23, |
| 577 "ts": 253200 | 577 "ts": 253200 |
| 578 }, | 578 }, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 599 "tid": 23, | 599 "tid": 23, |
| 600 "ts": 500000, | 600 "ts": 500000, |
| 601 "tts": 5612506 | 601 "tts": 5612506 |
| 602 } | 602 } |
| 603 ]; | 603 ]; |
| 604 | 604 |
| 605 var timeline = UI.panels.timeline; | 605 var timeline = UI.panels.timeline; |
| 606 timeline._setModel(InspectorTest.createPerformanceModelWithEvents(rawTraceEv
ents)); | 606 timeline._setModel(InspectorTest.createPerformanceModelWithEvents(rawTraceEv
ents)); |
| 607 | 607 |
| 608 timeline.requestWindowTimes(0, Infinity); | 608 timeline.requestWindowTimes(0, Infinity); |
| 609 await getTreeView("CallTree")._productRegistryPromiseForTest; |
| 610 await getTreeView("BottomUp")._productRegistryPromiseForTest; |
| 609 var groupByEnum = Timeline.AggregatedTimelineTreeView.GroupBy; | 611 var groupByEnum = Timeline.AggregatedTimelineTreeView.GroupBy; |
| 610 for (var grouping in groupByEnum) { | 612 for (var grouping of Object.values(groupByEnum)) { |
| 611 var groupingValue = groupByEnum[grouping]; | 613 testEventTree("CallTree", grouping); |
| 612 testEventTree("CallTree", groupingValue); | 614 testEventTree("BottomUp", grouping); |
| 613 testEventTree("BottomUp", groupingValue); | |
| 614 } | 615 } |
| 615 | |
| 616 testEventTree("EventLog"); | 616 testEventTree("EventLog"); |
| 617 InspectorTest.completeTest(); | 617 InspectorTest.completeTest(); |
| 618 | 618 |
| 619 function getTreeView(type) |
| 620 { |
| 621 if (timeline._tabbedPane) { |
| 622 timeline._tabbedPane.selectTab(type, true); |
| 623 return timeline._currentView._treeView; |
| 624 } |
| 625 timeline._currentView._detailsView._tabbedPane.selectTab(type, true); |
| 626 return timeline._currentView._detailsView._tabbedPane.visibleView; |
| 627 } |
| 628 |
| 619 function testEventTree(type, grouping) | 629 function testEventTree(type, grouping) |
| 620 { | 630 { |
| 621 InspectorTest.addResult(""); | 631 InspectorTest.addResult(""); |
| 622 var tree; | 632 var tree = getTreeView(type); |
| 623 if (timeline._tabbedPane) { | |
| 624 timeline._tabbedPane.selectTab(type, true); | |
| 625 tree = timeline._currentView._treeView; | |
| 626 } else { | |
| 627 timeline._currentView._detailsView._tabbedPane.selectTab(type, true)
; | |
| 628 tree = timeline._currentView._detailsView._tabbedPane.visibleView; | |
| 629 } | |
| 630 if (grouping) { | 633 if (grouping) { |
| 631 InspectorTest.addResult(type + " Group by: " + grouping); | 634 InspectorTest.addResult(type + " Group by: " + grouping); |
| 632 tree._groupByCombobox.select(tree._groupByCombobox.options().find(x
=> x.value === grouping)); | 635 tree._groupBySetting.set(grouping); |
| 633 tree._onGroupByChanged(); | |
| 634 } else { | 636 } else { |
| 635 InspectorTest.addResult(type); | 637 InspectorTest.addResult(type); |
| 636 } | 638 } |
| 637 var rootNode = tree._dataGrid.rootNode(); | 639 var rootNode = tree._dataGrid.rootNode(); |
| 638 for (var node of rootNode.children) | 640 for (var node of rootNode.children) |
| 639 printEventTree(1, node._profileNode, node._treeView); | 641 printEventTree(1, node._profileNode, node._treeView); |
| 640 } | 642 } |
| 641 | 643 |
| 642 function printEventTree(padding, node, treeView) | 644 function printEventTree(padding, node, treeView) |
| 643 { | 645 { |
| 644 var name; | 646 var name; |
| 645 if (node.isGroupNode()) { | 647 if (node.isGroupNode()) { |
| 646 name = treeView._displayInfoForGroupNode(node).name; | 648 name = treeView._displayInfoForGroupNode(node).name; |
| 647 } else { | 649 } else { |
| 648 name = node.event.name === TimelineModel.TimelineModel.RecordType.JSF
rame | 650 name = node.event.name === TimelineModel.TimelineModel.RecordType.JS
Frame |
| 649 ? UI.beautifyFunctionName(node.event.args["data"]["functio
nName"]) | 651 ? UI.beautifyFunctionName(node.event.args["data"]["functio
nName"]) |
| 650 : Timeline.TimelineUIUtils.eventTitle(node.event); | 652 : Timeline.TimelineUIUtils.eventTitle(node.event); |
| 651 } | 653 } |
| 652 InspectorTest.addResult(" ".repeat(padding) + `${name}: ${node.selfTime
.toFixed(3)} ${node.totalTime.toFixed(3)}`); | 654 InspectorTest.addResult(" ".repeat(padding) + `${name}: ${node.selfTime
.toFixed(3)} ${node.totalTime.toFixed(3)}`); |
| 653 node.children().forEach(printEventTree.bind(null, padding + 1)); | 655 node.children().forEach(printEventTree.bind(null, padding + 1)); |
| 654 } | 656 } |
| 655 } | 657 } |
| 656 | 658 |
| 657 </script> | 659 </script> |
| 658 </head> | 660 </head> |
| 659 <body onload="runTest()"> | 661 <body onload="runTest()"> |
| 660 </body> | 662 </body> |
| 661 </html> | 663 </html> |
| OLD | NEW |