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

Side by Side Diff: LayoutTests/inspector/timeline/timeline-frame-model.html

Issue 320523004: Timeline: fill frames according to CPU time spent per event category (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased 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 function initialize_timelineFrameModel()
7 {
8
9 InspectorTest.dumpFrame = function(frame)
10 {
11 var fieldsToDump = ["cpuTime", "duration", "startTime", "endTime", "id", "ma inThreadFrameId", "isBackground", "timeByCategory", "other", "scripting", "paint ing", "rendering", "committedFrom"];
12 function formatFields(object)
13 {
14 var result = {};
15 for (var key in object) {
16 if (fieldsToDump.indexOf(key) < 0)
17 continue;
18 var value = object[key];
19 if (typeof value === "number")
20 value = Number(value.toFixed(7));
21 else if (typeof value === "object" && value)
22 value = formatFields(value);
23 result[key] = value;
24 }
25 return result;
26 }
27 InspectorTest.addObject(formatFields(frame));
28 }
29
30 }
31
32 function test() 6 function test()
33 { 7 {
34 var testData = { 8 var testData = {
35 "main thread only": [ 9 "main thread only": [
36 {"startTime": 1000.000, "data":{},"endTime":1003.999, "type":"Progra m", "children":[ 10 {"startTime": 1000.000, "data":{},"endTime":1003.999, "type":"Progra m", "children":[
37 {"startTime":1000.001, "type":"BeginFrame", "data":{"id":"1"}}, 11 {"startTime":1000.001, "type":"BeginFrame", "data":{"id":"1"}},
38 {"startTime":1000.002, "endTime":1003.999, "type":"FunctionCall" } 12 {"startTime":1000.002, "endTime":1003.999, "type":"FunctionCall" }
39 ]}, 13 ]},
40 {"startTime": 1016.000, "data":{},"endTime":1026.999, "type":"Progra m", "children":[ 14 {"startTime": 1016.000, "data":{},"endTime":1026.999, "type":"Progra m", "children":[
41 {"startTime":1016.001, "type":"BeginFrame", "data":{"id":"2"}}, 15 {"startTime":1016.001, "type":"BeginFrame", "data":{"id":"2"}},
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 </script> 193 </script>
220 </head> 194 </head>
221 195
222 <body onload="runTest()"> 196 <body onload="runTest()">
223 <p> 197 <p>
224 Test timeline records coalescing 198 Test timeline records coalescing
225 </p> 199 </p>
226 200
227 </body> 201 </body>
228 </html> 202 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/timeline-test.js ('k') | LayoutTests/inspector/timeline/trace-event-self-time.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698