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

Side by Side Diff: LayoutTests/inspector/tracing/timeline-js-callstacks.html

Issue 1294183002: DevTools: Tweak id calculation for JSFrames (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline Created 5 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/inspector/tracing/timeline-js-callstacks-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 } 355 }
356 }, 356 },
357 "cat": "disabled-by-default-devtools.timeline", 357 "cat": "disabled-by-default-devtools.timeline",
358 "name": "JSSample", 358 "name": "JSSample",
359 "ph": "I", 359 "ph": "I",
360 "pid": 17851, 360 "pid": 17851,
361 "tid": 23, 361 "tid": 23,
362 "ts": 251100, 362 "ts": 251100,
363 }, 363 },
364 { 364 {
365 "args": {
366 "data": {
367 "stackTrace": [
368 { "functionName": "w", "scriptId": 1 },
369 { "functionName": "y", "callUID": "y", "scriptId": 1 },
370 { "functionName": "x", "callUID": "x", "scriptId": 1 }
371 ]
372 }
373 },
374 "cat": "disabled-by-default-devtools.timeline",
375 "name": "JSSample",
376 "ph": "I",
377 "pid": 17851,
378 "tid": 23,
379 "ts": 251200,
380 },
381 {
382 "args": {
383 "data": {
384 "stackTrace": [
385 { "functionName": "w", "scriptId": 1 },
386 { "functionName": "y", "callUID": "y", "scriptId": 1 },
387 { "functionName": "x", "callUID": "x", "scriptId": 1 }
388 ]
389 }
390 },
391 "cat": "disabled-by-default-devtools.timeline",
392 "name": "JSSample",
393 "ph": "I",
394 "pid": 17851,
395 "tid": 23,
396 "ts": 251300,
397 },
398 {
399 "args": {
400 "data": {
401 "stackTrace": [
402 { "functionName": "y", "callUID": "y", "scriptId": 1 },
403 { "functionName": "x", "callUID": "x", "scriptId": 1 }
404 ]
405 }
406 },
407 "cat": "disabled-by-default-devtools.timeline",
408 "name": "JSSample",
409 "ph": "I",
410 "pid": 17851,
411 "tid": 23,
412 "ts": 251400,
413 },
414 {
365 "args": {}, 415 "args": {},
366 "cat": "disabled-by-default-devtools.timeline", 416 "cat": "disabled-by-default-devtools.timeline",
367 "name": "Program", 417 "name": "Program",
368 "ph": "E", 418 "ph": "E",
369 "pid": 17851, 419 "pid": 17851,
370 "tid": 23, 420 "tid": 23,
371 "ts": 500000, 421 "ts": 500000,
372 "tts": 5612506 422 "tts": 5612506
373 } 423 }
374 ]; 424 ];
375 425
376 var tracingTimelineModel = InspectorTest.tracingTimelineModel(); 426 var tracingTimelineModel = InspectorTest.tracingTimelineModel();
377 tracingTimelineModel.setEventsForTest(rawTraceEvents); 427 tracingTimelineModel.setEventsForTest(rawTraceEvents);
378 var events = WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents(t racingTimelineModel.mainThreadEvents()); 428 var events = WebInspector.TimelineJSProfileProcessor.generateJSFrameEvents(t racingTimelineModel.mainThreadEvents());
379 events = events.mergeOrdered(tracingTimelineModel.mainThreadEvents(), WebIns pector.TracingModel.Event.orderedCompareStartTime); 429 events = events.mergeOrdered(tracingTimelineModel.mainThreadEvents(), WebIns pector.TracingModel.Event.orderedCompareStartTime);
380 events.filter(function(e) { return e.duration; }).forEach(function(e) { 430 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 | | "")); 431 InspectorTest.addResult(e.name + ": " + e.startTime.toFixed(3) + " / " + (e.duration.toFixed(3) || 0) + " " + (e.args.data && e.args.data.functionName | | ""));
382 }); 432 });
383 433
384 InspectorTest.addResult(""); 434 InspectorTest.addResult("");
385 tracingTimelineModel._setMainThreadEvents(events); 435 tracingTimelineModel._setMainThreadEvents(events);
386 var filters = [ 436 var filters = [
387 WebInspector.TimelineUIUtils.hiddenEventsFilter(), 437 WebInspector.TimelineUIUtils.hiddenEventsFilter(),
388 new WebInspector.ExcludeTopLevelFilter() 438 new WebInspector.ExcludeTopLevelFilter()
389 ]; 439 ];
390 var treeTopDown = WebInspector.TimelineModel.buildTopDownTree(events, 0, Inf inity, filters, eventId); 440 var treeTopDown = WebInspector.TimelineModel.buildTopDownTree(events, 0, Inf inity, filters, WebInspector.TimelineTreeView.eventId);
391 printProfileTree(0, treeTopDown); 441 printProfileTree(0, treeTopDown);
392 var treeBottomUp = WebInspector.TimelineModel.buildBottomUpTree(treeTopDown) ; 442 var treeBottomUp = WebInspector.TimelineModel.buildBottomUpTree(treeTopDown) ;
393 printProfileTree(0, treeBottomUp); 443 printProfileTree(0, treeBottomUp);
394 444
395 function eventId(event)
396 {
397 var data = event.args.data;
398 return data && (data.callUID || data.functionNode);
399 }
400
401 function printProfileTree(padding, node) 445 function printProfileTree(padding, node)
402 { 446 {
403 InspectorTest.addResult(" ".repeat(padding) + node.name + ": " + [node. selfTime, node.totalTime].map(function (t) { return t.toFixed(3); }).join(" ")) ; 447 InspectorTest.addResult(" ".repeat(padding) + node.name + ": " + [node. selfTime, node.totalTime].map(function (t) { return t.toFixed(3); }).join(" ")) ;
404 (node.children || new Map()).forEach(printProfileTree.bind(null, padding + 1)); 448 (node.children || new Map()).forEach(printProfileTree.bind(null, padding + 1));
405 } 449 }
406 450
407 InspectorTest.completeTest(); 451 InspectorTest.completeTest();
408 } 452 }
409 453
410 </script> 454 </script>
411 </head> 455 </head>
412 <body onload="runTest()"> 456 <body onload="runTest()">
413 </body> 457 </body>
414 </html> 458 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/tracing/timeline-js-callstacks-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698