Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-aggregated-details.html

Issue 2145873002: [DevTools] Split inspector/tracing into subdirectories to speed things up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/timeline-test.js"></script>
5 <script>
6
7 function test()
8 {
9 var sessionId = "6.23";
10 var rawTraceEvents = [
11 {
12 "args": {
13 "name": "Renderer"
14 },
15 "cat": "__metadata",
16 "name": "process_name",
17 "ph": "M",
18 "pid": 17851,
19 "tid": 23,
20 "ts": 0
21 },
22 {
23 "args": {
24 "name": "CrRendererMain"
25 },
26 "cat": "__metadata",
27 "name": "thread_name",
28 "ph": "M",
29 "pid": 17851,
30 "tid": 23,
31 "ts": 0
32 },
33 {
34 "args": {
35 "sessionId": sessionId
36 },
37 "cat": "disabled-by-default-devtools.timeline",
38 "name": "TracingStartedInPage",
39 "ph": "I",
40 "pid": 17851,
41 "tid": 23,
42 "ts": 100000,
43 "tts": 606543
44 },
45 {
46 "args": {},
47 "cat": "disabled-by-default-devtools.timeline",
48 "name": "Program",
49 "ph": "B",
50 "pid": 17851,
51 "tid": 23,
52 "ts": 200000,
53 "tts": 5612442
54 },
55 {
56 "args": {
57 "data": {
58 "stackTrace": [
59 { "functionName": "c", "callUID": "c", "scriptId": 1 },
60 { "functionName": "b", "callUID": "b", "scriptId": 1 },
61 { "functionName": "a", "callUID": "a", "scriptId": 1 }
62 ]
63 }
64 },
65 "cat": "disabled-by-default-devtools.timeline",
66 "name": "JSSample",
67 "ph": "I",
68 "pid": 17851,
69 "tid": 23,
70 "ts": 208000,
71 "tts": 1758056
72 },
73 {
74 "args": {},
75 "cat": "disabled-by-default-devtools.timeline",
76 "name": "FunctionCall",
77 "ph": "X",
78 "pid": 17851,
79 "tid": 23,
80 "ts": 210000,
81 "dur": 30000,
82 "tts": 5612442
83 },
84 {
85 "args": {
86 "data": {
87 "stackTrace": [
88 { "functionName": "c", "callUID": "c", "scriptId": 1 },
89 { "functionName": "b", "callUID": "b", "scriptId": 1 },
90 { "functionName": "a", "callUID": "a", "scriptId": 1 }
91 ]
92 }
93 },
94 "cat": "disabled-by-default-devtools.timeline",
95 "name": "JSSample",
96 "ph": "I",
97 "pid": 17851,
98 "tid": 23,
99 "ts": 211000,
100 "tts": 1758056
101 },
102 {
103 "args": {
104 "data": {
105 "stackTrace": []
106 }
107 },
108 "cat": "disabled-by-default-devtools.timeline",
109 "name": "JSSample",
110 "ph": "I",
111 "pid": 17851,
112 "tid": 23,
113 "ts": 212000,
114 "tts": 1758056
115 },
116 {
117 "args": {
118 "data": {
119 "stackTrace": [
120 { "functionName": "c", "callUID": "c", "scriptId": 1 },
121 { "functionName": "b", "callUID": "b", "scriptId": 1 },
122 { "functionName": "a", "callUID": "a", "scriptId": 1 }
123 ]
124 }
125 },
126 "cat": "disabled-by-default-devtools.timeline",
127 "name": "JSSample",
128 "ph": "I",
129 "pid": 17851,
130 "tid": 23,
131 "ts": 219875,
132 "tts": 1758056
133 },
134 {
135 "args": {
136 "frame": "0x2f7b63884000",
137 "data": {
138 "stackTrace": [
139 { "functionName": "b", "callUID": "b", "scriptId": 1 },
140 { "functionName": "a", "callUID": "a", "scriptId": 1 }
141 ]
142 }
143 },
144 "cat": "disabled-by-default-devtools.timeline",
145 "name": "InvalidateLayout",
146 "ph": "X",
147 "pid": 17851,
148 "tid": 23,
149 "ts": 220000,
150 "dur": 7000,
151 "tts": 1758056
152 },
153 {
154 "args": {
155 "data": {
156 "stackTrace": [
157 { "functionName": "c", "callUID": "c", "scriptId": 1 },
158 { "functionName": "b", "callUID": "b", "scriptId": 1 },
159 { "functionName": "a", "callUID": "a", "scriptId": 1 }
160 ]
161 }
162 },
163 "cat": "disabled-by-default-devtools.timeline",
164 "name": "JSSample",
165 "ph": "I",
166 "pid": 17851,
167 "tid": 23,
168 "ts": 220125,
169 "tts": 1758056
170 },
171 {
172 "args": {
173 "frame": "0x2f7b63884000",
174 "data": {
175 "stackTrace": [
176 { "functionName": "b", "callUID": "b", "scriptId": 1 },
177 { "functionName": "a", "callUID": "a", "scriptId": 1 }
178 ]
179 }
180 },
181 "cat": "disabled-by-default-devtools.timeline",
182 "name": "InvalidateLayout",
183 "ph": "X",
184 "pid": 17851,
185 "tid": 23,
186 "ts": 221000,
187 "dur": 3000,
188 "tts": 1758056
189 },
190 {
191 "args": {
192 "data": {
193 "stackTrace": [
194 { "functionName": "g", "scriptId": 1 },
195 { "functionName": "f", "scriptId": 1 },
196 { "functionName": "b", "scriptId": 1 },
197 { "functionName": "a", "scriptId": 1 }
198 ]
199 }
200 },
201 "cat": "disabled-by-default-devtools.timeline",
202 "name": "JSSample",
203 "ph": "I",
204 "pid": 17851,
205 "tid": 23,
206 "ts": 222000,
207 "tts": 1758056
208 },
209 {
210 "args": {
211 "data": {
212 "stackTrace": [
213 { "functionName": "g", "scriptId": 1 },
214 { "functionName": "e", "scriptId": 1 },
215 { "functionName": "b", "scriptId": 1 },
216 { "functionName": "a", "scriptId": 1 }
217 ]
218 }
219 },
220 "cat": "disabled-by-default-devtools.timeline",
221 "name": "JSSample",
222 "ph": "I",
223 "pid": 17851,
224 "tid": 23,
225 "ts": 227125,
226 "tts": 1758056
227 },
228 {
229 "args": {
230 "data": {
231 "stackTrace": [
232 { "functionName": "g", "scriptId": 1 },
233 { "functionName": "e", "scriptId": 1 },
234 { "functionName": "b", "scriptId": 1 },
235 { "functionName": "a", "scriptId": 1 }
236 ]
237 }
238 },
239 "cat": "disabled-by-default-devtools.timeline",
240 "name": "JSSample",
241 "ph": "I",
242 "pid": 17851,
243 "tid": 23,
244 "ts": 227250,
245 "tts": 1758056
246 },
247 {
248 "args": {
249 "data": {
250 "stackTrace": [
251 { "functionName": "a", "callUID": "a", "scriptId": 1 },
252 { "functionName": "l", "callUID": "l", "scriptId": 1 },
253 { "functionName": "f", "callUID": "f", "scriptId": 1 }
254 ]
255 }
256 },
257 "cat": "disabled-by-default-devtools.timeline",
258 "name": "JSSample",
259 "ph": "I",
260 "pid": 17851,
261 "tid": 23,
262 "ts": 230000,
263 "tts": 1758056
264 },
265 {
266 "args": {
267 "beginData": {
268 "stackTrace": [
269 { "functionName": "a", "callUID": "a", "scriptId": 1 },
270 { "functionName": "l", "callUID": "l", "scriptId": 1 },
271 { "functionName": "f", "callUID": "f", "scriptId": 1 },
272 { "functionName": "sin", "callUID": "sin", "scriptId": 2, "u rl": "native math.js" }
273 ]
274 }
275 },
276 "cat": "disabled-by-default-devtools.timeline",
277 "name": "Layout",
278 "ph": "X",
279 "dur": 100,
280 "pid": 17851,
281 "tid": 23,
282 "ts": 230010,
283 "tts": 1758056
284 },
285 {
286 "args": {
287 "data": {
288 "stackTrace": [
289 { "functionName": "a", "callUID": "a", "scriptId": 1 },
290 { "functionName": "l", "callUID": "l", "scriptId": 1 },
291 { "functionName": "f", "callUID": "f", "scriptId": 1 },
292 { "functionName": "sin", "callUID": "sin", "scriptId": 2, "u rl": "native math.js" }
293 ]
294 }
295 },
296 "cat": "disabled-by-default-devtools.timeline",
297 "name": "TimerInstall",
298 "ph": "I",
299 "pid": 17851,
300 "tid": 23,
301 "ts": 230111
302 },
303 {
304 "args": {
305 "data": {
306 "stackTrace": [
307 { "functionName": "a", "callUID": "a", "scriptId": 1 },
308 { "functionName": "l", "callUID": "l", "scriptId": 1 },
309 { "functionName": "f", "callUID": "f", "scriptId": 1 },
310 { "functionName": "sin", "callUID": "sin", "scriptId": 2, "u rl": "native math.js" }
311 ]
312 }
313 },
314 "cat": "disabled-by-default-devtools.timeline",
315 "name": "JSSample",
316 "ph": "I",
317 "pid": 17851,
318 "tid": 23,
319 "ts": 230125
320 },
321 {
322 "args": {},
323 "cat": "disabled-by-default-devtools.timeline",
324 "name": "FunctionCall",
325 "ph": "X",
326 "pid": 17851,
327 "tid": 23,
328 "ts": 250000,
329 "dur": 10000
330 },
331 {
332 "args": {
333 "data": {
334 "stackTrace": [
335 { "functionName": "y", "callUID": "y", "scriptId": 1 },
336 { "functionName": "x", "callUID": "x", "scriptId": 1 }
337 ]
338 }
339 },
340 "cat": "disabled-by-default-devtools.timeline",
341 "name": "FunctionCall",
342 "ph": "X",
343 "pid": 17851,
344 "tid": 23,
345 "ts": 251000,
346 "dur": 1000
347 },
348 {
349 "args": {
350 "data": {
351 "stackTrace": [
352 { "functionName": "w", "callUID": "w", "scriptId": 1 },
353 { "functionName": "z", "callUID": "z", "scriptId": 1 },
354 { "functionName": "y", "callUID": "y", "scriptId": 1 },
355 { "functionName": "x", "callUID": "x", "scriptId": 1 }
356 ]
357 }
358 },
359 "cat": "disabled-by-default-devtools.timeline",
360 "name": "JSSample",
361 "ph": "I",
362 "pid": 17851,
363 "tid": 23,
364 "ts": 251000
365 },
366 {
367 "args": {
368 "data": {
369 "stackTrace": [
370 { "functionName": "w", "callUID": "w", "scriptId": 1 },
371 { "functionName": "z", "callUID": "z", "scriptId": 1 },
372 { "functionName": "y", "callUID": "y", "scriptId": 1 },
373 { "functionName": "x", "callUID": "x", "scriptId": 1 }
374 ]
375 }
376 },
377 "cat": "disabled-by-default-devtools.timeline",
378 "name": "JSSample",
379 "ph": "I",
380 "pid": 17851,
381 "tid": 23,
382 "ts": 251100
383 },
384 {
385 "args": {
386 "data": {
387 "stackTrace": [
388 { "functionName": "w", "scriptId": 1 },
389 { "functionName": "y", "callUID": "y", "scriptId": 1 },
390 { "functionName": "x", "callUID": "x", "scriptId": 1 }
391 ]
392 }
393 },
394 "cat": "disabled-by-default-devtools.timeline",
395 "name": "JSSample",
396 "ph": "I",
397 "pid": 17851,
398 "tid": 23,
399 "ts": 251200
400 },
401 {
402 "args": {
403 "data": {
404 "stackTrace": [
405 { "functionName": "w", "scriptId": 1 },
406 { "functionName": "y", "callUID": "y", "scriptId": 1 },
407 { "functionName": "x", "callUID": "x", "scriptId": 1 }
408 ]
409 }
410 },
411 "cat": "disabled-by-default-devtools.timeline",
412 "name": "JSSample",
413 "ph": "I",
414 "pid": 17851,
415 "tid": 23,
416 "ts": 251300
417 },
418 {
419 "args": {
420 "data": {
421 "stackTrace": [
422 { "functionName": "y", "callUID": "y", "scriptId": 1 },
423 { "functionName": "x", "callUID": "x", "scriptId": 1 }
424 ]
425 }
426 },
427 "cat": "disabled-by-default-devtools.timeline",
428 "name": "JSSample",
429 "ph": "I",
430 "pid": 17851,
431 "tid": 23,
432 "ts": 251400
433 },
434 {
435 "args": {
436 "data": {
437 "stackTrace": [
438 { "functionName": "recursive_b", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" },
439 { "functionName": "recursive_a", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" },
440 { "functionName": "recursive_b", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" },
441 { "functionName": "recursive_a", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" }
442 ]
443 }
444 },
445 "cat": "disabled-by-default-devtools.timeline",
446 "name": "JSSample",
447 "ph": "I",
448 "pid": 17851,
449 "tid": 23,
450 "ts": 253000
451 },
452 {
453 "args": {
454 "data": {
455 "stackTrace": [
456 { "functionName": "recursive_a", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" },
457 { "functionName": "recursive_b", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" },
458 { "functionName": "recursive_a", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" }
459 ]
460 }
461 },
462 "cat": "disabled-by-default-devtools.timeline",
463 "name": "JSSample",
464 "ph": "I",
465 "pid": 17851,
466 "tid": 23,
467 "ts": 253008
468 },
469 {
470 "args": {
471 "data": {
472 "stackTrace": [
473 { "functionName": "recursive_b", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" },
474 { "functionName": "recursive_a", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" }
475 ]
476 }
477 },
478 "cat": "disabled-by-default-devtools.timeline",
479 "name": "JSSample",
480 "ph": "I",
481 "pid": 17851,
482 "tid": 23,
483 "ts": 253012
484 },
485 {
486 "args": {
487 "data": {
488 "stackTrace": [
489 { "functionName": "recursive_a", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" }
490 ]
491 }
492 },
493 "cat": "disabled-by-default-devtools.timeline",
494 "name": "JSSample",
495 "ph": "I",
496 "pid": 17851,
497 "tid": 23,
498 "ts": 253014
499 },
500 {
501 "args": {
502 "data": {
503 "stackTrace": [
504 ]
505 }
506 },
507 "cat": "disabled-by-default-devtools.timeline",
508 "name": "JSSample",
509 "ph": "I",
510 "pid": 17851,
511 "tid": 23,
512 "ts": 253015
513 },
514 {
515 "args": {
516 "data": {
517 "stackTrace": [
518 { "functionName": "recursive_b", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" },
519 { "functionName": "recursive_a", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" }
520 ]
521 }
522 },
523 "cat": "disabled-by-default-devtools.timeline",
524 "name": "JSSample",
525 "ph": "I",
526 "pid": 17851,
527 "tid": 23,
528 "ts": 253100
529 },
530 {
531 "args": {
532 "data": {
533 "stackTrace": [
534 { "functionName": "recursive_a", "scriptId": 1, "url": "http ://xyz.abc.com/rec.js" }
535 ]
536 }
537 },
538 "cat": "disabled-by-default-devtools.timeline",
539 "name": "JSSample",
540 "ph": "I",
541 "pid": 17851,
542 "tid": 23,
543 "ts": 253200
544 },
545 {
546 "args": {
547 "data": {
548 "stackTrace": [
549 ]
550 }
551 },
552 "cat": "disabled-by-default-devtools.timeline",
553 "name": "JSSample",
554 "ph": "I",
555 "pid": 17851,
556 "tid": 23,
557 "ts": 253300
558 },
559 {
560 "args": {},
561 "cat": "disabled-by-default-devtools.timeline",
562 "name": "Program",
563 "ph": "E",
564 "pid": 17851,
565 "tid": 23,
566 "ts": 500000,
567 "tts": 5612506
568 }
569 ];
570
571 var timeline = WebInspector.panels.timeline;
572 InspectorTest.setTraceEvents(InspectorTest.timelineModel(), InspectorTest.tr acingModel(), rawTraceEvents);
573
574 timeline.requestWindowTimes(0, Infinity);
575 for (var grouping in WebInspector.TimelineAggregator.GroupBy) {
576 var groupingValue = WebInspector.TimelineAggregator.GroupBy[grouping];
577 testEventTree(WebInspector.TimelinePanel.DetailsTab.CallTree, groupingVa lue);
578 testEventTree(WebInspector.TimelinePanel.DetailsTab.BottomUp, groupingVa lue);
579 }
580
581 testEventTree(WebInspector.TimelinePanel.DetailsTab.Events);
582 InspectorTest.completeTest();
583
584 function testEventTree(type, grouping)
585 {
586 InspectorTest.addResult("");
587 timeline._detailsView.selectTab(type, true);
588 var callTree = timeline._detailsView._rangeDetailViews.get(type);
589 if (grouping) {
590 InspectorTest.addResult(type + " Group by: " + grouping);
591 callTree._groupByCombobox.select(callTree._groupByCombobox.options() .find((x) => x.value === grouping));
592 callTree._onGroupByChanged();
593 } else {
594 InspectorTest.addResult(type);
595 }
596 var rootNode = callTree._dataGrid.rootNode();
597 for (var node of rootNode.children)
598 printEventTree(1, node._profileNode, node._treeView);
599 }
600
601 function printEventTree(padding, node, treeView)
602 {
603 var name;
604 if (node.isGroupNode()) {
605 name = treeView._displayInfoForGroupNode(node).name;
606 } else {
607 name = node.event.name === WebInspector.TimelineModel.RecordType.JSFr ame
608 ? WebInspector.beautifyFunctionName(node.event.args["data" ]["functionName"])
609 : WebInspector.TimelineUIUtils.eventTitle(node.event);
610 }
611 InspectorTest.addResult(" ".repeat(padding) + name + ": " + [node.selfT ime, node.totalTime].map(function (t) { return t.toFixed(3); }).join(" "));
612 (node.children || new Map()).forEach(printEventTree.bind(null, padding + 1));
613 }
614 }
615
616 </script>
617 </head>
618 <body onload="runTest()">
619 </body>
620 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698