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

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

Issue 1315373005: DevTools: remove most convenience wrappers from WI.TimelineModel.Record (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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/tracing/timeline-coalescing.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 a29e17a01b23a4d28d717ddb8be16adaf60b1cbf..588e57d31d472a8a35e4922d2bdb88522187c6c3 100644
--- a/LayoutTests/http/tests/inspector/timeline-test.js
+++ b/LayoutTests/http/tests/inspector/timeline-test.js
@@ -283,18 +283,24 @@ InspectorTest.dumpTimelineRecords = function(timelineRecords)
InspectorTest.printTimelineRecordProperties = function(record)
{
InspectorTest.addResult(record.type() + " Properties:");
- var object = {};
- var names = ["data", "endTime", "frameId", "stackTrace", "startTime", "thread", "type"];
- for (var i = 0; i < names.length; i++) {
- var name = names[i];
- var value = record[name].call(record);
- if (value)
- object[name] = value;
+ var traceEvent = record.traceEvent();
+ var data = traceEvent.args["beginData"] || traceEvent.args["data"];
+ var frameId = data && data["frame"];
+ var object = {
+ data: traceEvent.args["data"] || traceEvent.args,
+ endTime: record.endTime(),
+ frameId: frameId,
+ stackTrace: traceEvent.stackTrace,
+ startTime: record.startTime(),
+ thread: record.thread(),
+ type: record.type()
+ };
+ for (var field in object) {
+ if (object[field] === null || object[field] === undefined)
yurys 2015/09/10 00:10:16 Can we get formatters to take care of this?
+ delete object[field];
}
if (record.children().length)
object["children"] = [];
- if (!record.data())
- object["data"] = record.traceEvent().args;
InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters);
};
« no previous file with comments | « no previous file | LayoutTests/inspector/tracing/timeline-coalescing.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698