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

Side by Side Diff: LayoutTests/inspector/timeline/timeline-coalescing.html

Issue 337023004: Don't create TimelineModel.RecordImpl in TimelinePresentationModel.js (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 6 years, 6 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 | Annotate | Revision Log
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="../../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 initialize_TimelineCoalescing() 7 function initialize_TimelineCoalescing()
8 { 8 {
9 9
10 InspectorTest.dumpStats = function(record) 10 InspectorTest.dumpStats = function(presentationRecord)
11 { 11 {
12 if (record.type() === "Root") 12 if (!presentationRecord.presentationParent())
13 return ""; 13 return "";
14 var aggregatedStats = record.aggregatedStats(); 14 var aggregatedStats = presentationRecord.presentationAggregatedStats();
15 var timeByCategory = ""; 15 var timeByCategory = "";
16 16
17 for (category in aggregatedStats) { 17 for (category in aggregatedStats) {
18 if (timeByCategory) 18 if (timeByCategory)
19 timeByCategory += ", "; 19 timeByCategory += ", ";
20 timeByCategory += category + ": " + aggregatedStats[category].toFixed(5) ; 20 timeByCategory += category + ": " + aggregatedStats[category].toFixed(5) ;
21 } 21 }
22 var duration = (record.endTime() - record.startTime()).toFixed(5); 22 var duration = (presentationRecord.endTime() - presentationRecord.startTime( )).toFixed(5);
23 var durationTillLastChild = (record.endTime() - record.startTime()).toFixed( 5); 23 var durationTillLastChild = (presentationRecord.endTime() - presentationReco rd.startTime()).toFixed(5);
24 return "duration: " + duration + ":" + durationTillLastChild + (timeByCatego ry ? " (" + timeByCategory + ")" : ""); 24 return "duration: " + duration + ":" + durationTillLastChild + (timeByCatego ry ? " (" + timeByCategory + ")" : "");
25 } 25 }
26 26
27 } 27 }
28 28
29 function test() 29 function test()
30 { 30 {
31 var records = [ 31 var records = [
32 // Assure we coalesce records with sort interval and don't coalesce reco rds that stand apart. 32 // Assure we coalesce records with sort interval and don't coalesce reco rds that stand apart.
33 {"startTime": 1000.000,"data":{},"endTime":1099.999,"type":"Program","ch ildren":[ 33 {"startTime": 1000.000,"data":{},"endTime":1099.999,"type":"Program","ch ildren":[
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 </script> 94 </script>
95 </head> 95 </head>
96 96
97 <body onload="runTest()"> 97 <body onload="runTest()">
98 <p> 98 <p>
99 Test timeline records coalescing 99 Test timeline records coalescing
100 </p> 100 </p>
101 101
102 </body> 102 </body>
103 </html> 103 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/timeline-test.js ('k') | Source/devtools/front_end/timeline/TimelineFlameChart.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698