| 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 14 matching lines...) Expand all Loading... |
| 25 }, | 25 }, |
| 26 "cat": "__metadata", | 26 "cat": "__metadata", |
| 27 "name": "thread_name", | 27 "name": "thread_name", |
| 28 "ph": "M", | 28 "ph": "M", |
| 29 "pid": 17851, | 29 "pid": 17851, |
| 30 "tid": 23, | 30 "tid": 23, |
| 31 "ts": 0 | 31 "ts": 0 |
| 32 }, | 32 }, |
| 33 { | 33 { |
| 34 "args": { | 34 "args": { |
| 35 "sessionId": sessionId | 35 "data": { |
| 36 "page": "0x2f7b63884000", |
| 37 "sessionId": sessionId, |
| 38 "frames": [ |
| 39 {"frame": "0x2f7b63884000", "url": "top-page-url", "name": "
top-page-name"}, |
| 40 {"frame": "0x2f7b63884100", "url": "subframe-url1", "name":
"subframe-name1"}, |
| 41 {"frame": "0x2f7b63884200", "url": "about:blank", "name": "s
ubframe-name2"} |
| 42 ] |
| 43 } |
| 36 }, | 44 }, |
| 37 "cat": "disabled-by-default-devtools.timeline", | 45 "cat": "disabled-by-default-devtools.timeline", |
| 38 "name": "TracingStartedInPage", | 46 "name": "TracingStartedInPage", |
| 39 "ph": "I", | 47 "ph": "I", |
| 40 "pid": 17851, | 48 "pid": 17851, |
| 41 "tid": 23, | 49 "tid": 23, |
| 42 "ts": 100000, | 50 "ts": 100000, |
| 43 "tts": 606543 | 51 "tts": 606543 |
| 44 }, | 52 }, |
| 45 { | 53 { |
| 54 "args": { |
| 55 "data": { |
| 56 "frame": "0x2f7b63884300", |
| 57 "url": "subframe-url3", |
| 58 "name": "subframe-name3" |
| 59 } |
| 60 }, |
| 61 "cat": "disabled-by-default-devtools.timeline", |
| 62 "name": "CommitLoad", |
| 63 "ph": "I", |
| 64 "pid": 17851, |
| 65 "tid": 23, |
| 66 "ts": 100010, |
| 67 "tts": 606544 |
| 68 }, |
| 69 { |
| 46 "args": {}, | 70 "args": {}, |
| 47 "cat": "disabled-by-default-devtools.timeline", | 71 "cat": "disabled-by-default-devtools.timeline", |
| 48 "name": "Program", | 72 "name": "Program", |
| 49 "ph": "B", | 73 "ph": "B", |
| 50 "pid": 17851, | 74 "pid": 17851, |
| 51 "tid": 23, | 75 "tid": 23, |
| 52 "ts": 200000, | 76 "ts": 200000, |
| 53 "tts": 5612442 | 77 "tts": 5612442 |
| 54 }, | 78 }, |
| 55 { | 79 { |
| 56 "args": { | 80 "args": { |
| 57 "data": { | 81 "data": { |
| 58 "stackTrace": [ | 82 "stackTrace": [ |
| 59 { "functionName": "c", "callUID": "c", "scriptId": 1 }, | 83 { "functionName": "c", "callUID": "c", "scriptId": 1 }, |
| 60 { "functionName": "b", "callUID": "b", "scriptId": 1 }, | 84 { "functionName": "b", "callUID": "b", "scriptId": 1 }, |
| 61 { "functionName": "a", "callUID": "a", "scriptId": 1 } | 85 { "functionName": "a", "callUID": "a", "scriptId": 1 } |
| 62 ] | 86 ] |
| 63 } | 87 } |
| 64 }, | 88 }, |
| 65 "cat": "disabled-by-default-devtools.timeline", | 89 "cat": "disabled-by-default-devtools.timeline", |
| 66 "name": "JSSample", | 90 "name": "JSSample", |
| 67 "ph": "I", | 91 "ph": "I", |
| 68 "pid": 17851, | 92 "pid": 17851, |
| 69 "tid": 23, | 93 "tid": 23, |
| 70 "ts": 208000, | 94 "ts": 208000, |
| 71 "tts": 1758056 | 95 "tts": 1758056 |
| 72 }, | 96 }, |
| 73 { | 97 { |
| 74 "args": {}, | 98 "args": { "data": { "frame": "0x2f7b63884100" } }, |
| 75 "cat": "disabled-by-default-devtools.timeline", | 99 "cat": "disabled-by-default-devtools.timeline", |
| 76 "name": "FunctionCall", | 100 "name": "FunctionCall", |
| 77 "ph": "X", | 101 "ph": "X", |
| 78 "pid": 17851, | 102 "pid": 17851, |
| 79 "tid": 23, | 103 "tid": 23, |
| 80 "ts": 210000, | 104 "ts": 210000, |
| 81 "dur": 30000, | 105 "dur": 30000, |
| 82 "tts": 5612442 | 106 "tts": 5612442 |
| 83 }, | 107 }, |
| 84 { | 108 { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 "cat": "disabled-by-default-devtools.timeline", | 150 "cat": "disabled-by-default-devtools.timeline", |
| 127 "name": "JSSample", | 151 "name": "JSSample", |
| 128 "ph": "I", | 152 "ph": "I", |
| 129 "pid": 17851, | 153 "pid": 17851, |
| 130 "tid": 23, | 154 "tid": 23, |
| 131 "ts": 219875, | 155 "ts": 219875, |
| 132 "tts": 1758056 | 156 "tts": 1758056 |
| 133 }, | 157 }, |
| 134 { | 158 { |
| 135 "args": { | 159 "args": { |
| 136 "frame": "0x2f7b63884000", | |
| 137 "data": { | 160 "data": { |
| 161 "frame": "0x2f7b63884000", |
| 138 "stackTrace": [ | 162 "stackTrace": [ |
| 139 { "functionName": "b", "callUID": "b", "scriptId": 1 }, | 163 { "functionName": "b", "callUID": "b", "scriptId": 1 }, |
| 140 { "functionName": "a", "callUID": "a", "scriptId": 1 } | 164 { "functionName": "a", "callUID": "a", "scriptId": 1 } |
| 141 ] | 165 ] |
| 142 } | 166 } |
| 143 }, | 167 }, |
| 144 "cat": "disabled-by-default-devtools.timeline", | 168 "cat": "disabled-by-default-devtools.timeline", |
| 145 "name": "InvalidateLayout", | 169 "name": "InvalidateLayout", |
| 146 "ph": "X", | 170 "ph": "X", |
| 147 "pid": 17851, | 171 "pid": 17851, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 163 "cat": "disabled-by-default-devtools.timeline", | 187 "cat": "disabled-by-default-devtools.timeline", |
| 164 "name": "JSSample", | 188 "name": "JSSample", |
| 165 "ph": "I", | 189 "ph": "I", |
| 166 "pid": 17851, | 190 "pid": 17851, |
| 167 "tid": 23, | 191 "tid": 23, |
| 168 "ts": 220125, | 192 "ts": 220125, |
| 169 "tts": 1758056 | 193 "tts": 1758056 |
| 170 }, | 194 }, |
| 171 { | 195 { |
| 172 "args": { | 196 "args": { |
| 173 "frame": "0x2f7b63884000", | |
| 174 "data": { | 197 "data": { |
| 198 "frame": "0x2f7b63884000", |
| 175 "stackTrace": [ | 199 "stackTrace": [ |
| 176 { "functionName": "b", "callUID": "b", "scriptId": 1 }, | 200 { "functionName": "b", "callUID": "b", "scriptId": 1 }, |
| 177 { "functionName": "a", "callUID": "a", "scriptId": 1 } | 201 { "functionName": "a", "callUID": "a", "scriptId": 1 } |
| 178 ] | 202 ] |
| 179 } | 203 } |
| 180 }, | 204 }, |
| 181 "cat": "disabled-by-default-devtools.timeline", | 205 "cat": "disabled-by-default-devtools.timeline", |
| 182 "name": "InvalidateLayout", | 206 "name": "InvalidateLayout", |
| 183 "ph": "X", | 207 "ph": "X", |
| 184 "pid": 17851, | 208 "pid": 17851, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 "name": "JSSample", | 282 "name": "JSSample", |
| 259 "ph": "I", | 283 "ph": "I", |
| 260 "pid": 17851, | 284 "pid": 17851, |
| 261 "tid": 23, | 285 "tid": 23, |
| 262 "ts": 230000, | 286 "ts": 230000, |
| 263 "tts": 1758056 | 287 "tts": 1758056 |
| 264 }, | 288 }, |
| 265 { | 289 { |
| 266 "args": { | 290 "args": { |
| 267 "beginData": { | 291 "beginData": { |
| 292 "frame": "0x2f7b63884200", |
| 268 "stackTrace": [ | 293 "stackTrace": [ |
| 269 { "functionName": "a", "callUID": "a", "scriptId": 1 }, | 294 { "functionName": "a", "callUID": "a", "scriptId": 1 }, |
| 270 { "functionName": "l", "callUID": "l", "scriptId": 1 }, | 295 { "functionName": "l", "callUID": "l", "scriptId": 1 }, |
| 271 { "functionName": "f", "callUID": "f", "scriptId": 1 }, | 296 { "functionName": "f", "callUID": "f", "scriptId": 1 }, |
| 272 { "functionName": "sin", "callUID": "sin", "scriptId": 2, "u
rl": "native math.js" } | 297 { "functionName": "sin", "callUID": "sin", "scriptId": 2, "u
rl": "native math.js" } |
| 273 ] | 298 ] |
| 274 } | 299 } |
| 275 }, | 300 }, |
| 276 "cat": "disabled-by-default-devtools.timeline", | 301 "cat": "disabled-by-default-devtools.timeline", |
| 277 "name": "Layout", | 302 "name": "Layout", |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 } | 337 } |
| 313 }, | 338 }, |
| 314 "cat": "disabled-by-default-devtools.timeline", | 339 "cat": "disabled-by-default-devtools.timeline", |
| 315 "name": "JSSample", | 340 "name": "JSSample", |
| 316 "ph": "I", | 341 "ph": "I", |
| 317 "pid": 17851, | 342 "pid": 17851, |
| 318 "tid": 23, | 343 "tid": 23, |
| 319 "ts": 230125 | 344 "ts": 230125 |
| 320 }, | 345 }, |
| 321 { | 346 { |
| 322 "args": {}, | 347 "args": { "data": {"frame": "0x2f7b63884300" } }, |
| 323 "cat": "disabled-by-default-devtools.timeline", | 348 "cat": "disabled-by-default-devtools.timeline", |
| 324 "name": "FunctionCall", | 349 "name": "FunctionCall", |
| 325 "ph": "X", | 350 "ph": "X", |
| 326 "pid": 17851, | 351 "pid": 17851, |
| 327 "tid": 23, | 352 "tid": 23, |
| 328 "ts": 250000, | 353 "ts": 250000, |
| 329 "dur": 10000 | 354 "dur": 10000 |
| 330 }, | 355 }, |
| 331 { | 356 { |
| 332 "args": { | 357 "args": { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 "tid": 23, | 590 "tid": 23, |
| 566 "ts": 500000, | 591 "ts": 500000, |
| 567 "tts": 5612506 | 592 "tts": 5612506 |
| 568 } | 593 } |
| 569 ]; | 594 ]; |
| 570 | 595 |
| 571 var timeline = WebInspector.panels.timeline; | 596 var timeline = WebInspector.panels.timeline; |
| 572 InspectorTest.setTraceEvents(InspectorTest.timelineModel(), InspectorTest.tr
acingModel(), rawTraceEvents); | 597 InspectorTest.setTraceEvents(InspectorTest.timelineModel(), InspectorTest.tr
acingModel(), rawTraceEvents); |
| 573 | 598 |
| 574 timeline.requestWindowTimes(0, Infinity); | 599 timeline.requestWindowTimes(0, Infinity); |
| 575 for (var grouping in WebInspector.TimelineAggregator.GroupBy) { | 600 var groupByEnum = WebInspector.AggregatedTimelineTreeView.GroupBy; |
| 576 var groupingValue = WebInspector.TimelineAggregator.GroupBy[grouping]; | 601 for (var grouping in groupByEnum) { |
| 602 var groupingValue = groupByEnum[grouping]; |
| 577 testEventTree(WebInspector.TimelinePanel.DetailsTab.CallTree, groupingVa
lue); | 603 testEventTree(WebInspector.TimelinePanel.DetailsTab.CallTree, groupingVa
lue); |
| 578 testEventTree(WebInspector.TimelinePanel.DetailsTab.BottomUp, groupingVa
lue); | 604 testEventTree(WebInspector.TimelinePanel.DetailsTab.BottomUp, groupingVa
lue); |
| 579 } | 605 } |
| 580 | 606 |
| 581 testEventTree(WebInspector.TimelinePanel.DetailsTab.Events); | 607 testEventTree(WebInspector.TimelinePanel.DetailsTab.Events); |
| 582 InspectorTest.completeTest(); | 608 InspectorTest.completeTest(); |
| 583 | 609 |
| 584 function testEventTree(type, grouping) | 610 function testEventTree(type, grouping) |
| 585 { | 611 { |
| 586 InspectorTest.addResult(""); | 612 InspectorTest.addResult(""); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 611 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)}`); |
| 612 (node.children || new Map()).forEach(printEventTree.bind(null, padding +
1)); | 638 (node.children || new Map()).forEach(printEventTree.bind(null, padding +
1)); |
| 613 } | 639 } |
| 614 } | 640 } |
| 615 | 641 |
| 616 </script> | 642 </script> |
| 617 </head> | 643 </head> |
| 618 <body onload="runTest()"> | 644 <body onload="runTest()"> |
| 619 </body> | 645 </body> |
| 620 </html> | 646 </html> |
| OLD | NEW |