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

Unified Diff: LayoutTests/http/tests/inspector/timeline-test.js

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/inspector/timeline/timeline-frame-model.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/inspector/timeline-test.js
diff --git a/LayoutTests/http/tests/inspector/timeline-test.js b/LayoutTests/http/tests/inspector/timeline-test.js
index a8c5796b0d87b2439133d08ee751e215ce1c977f..9d4933ec41042d116fc3529d7c413095582d3a73 100644
--- a/LayoutTests/http/tests/inspector/timeline-test.js
+++ b/LayoutTests/http/tests/inspector/timeline-test.js
@@ -282,6 +282,27 @@ InspectorTest.FakeFileReader = function(input, delegate, callback)
this._fileSize = input.length;
};
+InspectorTest.dumpFrame = function(frame)
+{
+ var fieldsToDump = ["cpuTime", "duration", "startTime", "endTime", "id", "mainThreadFrameId", "isBackground", "timeByCategory", "other", "scripting", "painting", "rendering", "committedFrom"];
+ function formatFields(object)
+ {
+ var result = {};
+ for (var key in object) {
+ if (fieldsToDump.indexOf(key) < 0)
+ continue;
+ var value = object[key];
+ if (typeof value === "number")
+ value = Number(value.toFixed(7));
+ else if (typeof value === "object" && value)
+ value = formatFields(value);
+ result[key] = value;
+ }
+ return result;
+ }
+ InspectorTest.addObject(formatFields(frame));
+}
+
InspectorTest.FakeFileReader.prototype = {
start: function(output)
{
« no previous file with comments | « no previous file | LayoutTests/inspector/timeline/timeline-frame-model.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698