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) |
{ |