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

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

Issue 183893010: DevTools: extract TimelineModel.Record from TimelinePresentationModel.Record. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For landing Created 6 years, 10 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/http/tests/inspector/websocket/timeline-websocket-event.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 e1fc74cbffd314ce83a826ae2de8718f3e9d9952..5b11bead145479e9be3580daf9d0b6a90869ce46 100644
--- a/LayoutTests/http/tests/inspector/timeline-test.js
+++ b/LayoutTests/http/tests/inspector/timeline-test.js
@@ -152,9 +152,7 @@ InspectorTest.dumpTimelineRecord = function(record, detailsCallback, level, filt
prefix = "----" + prefix;
if (level > 0)
prefix = prefix + "> ";
- if (record.coalesced) {
- suffix = " x " + record.children.length;
- } else if (record.type === WebInspector.TimelineModel.RecordType.TimeStamp
+ if (record.type === WebInspector.TimelineModel.RecordType.TimeStamp
|| record.type === WebInspector.TimelineModel.RecordType.ConsoleTime) {
suffix = " : " + record.data.message;
}
@@ -170,6 +168,36 @@ InspectorTest.dumpTimelineRecord = function(record, detailsCallback, level, filt
}
}
+// Dump just the record name, indenting output on separate lines for subrecords
+InspectorTest.dumpPresentationRecord = function(presentationRecord, detailsCallback, level, filterTypes)
+{
+ var record = presentationRecord.record();
+ if (typeof level !== "number")
+ level = 0;
+ var prefix = "";
+ var suffix = "";
+ for (var i = 0; i < level ; ++i)
+ prefix = "----" + prefix;
+ if (level > 0)
+ prefix = prefix + "> ";
+ if (presentationRecord.coalesced()) {
+ suffix = " x " + presentationRecord.presentationChildren().length;
+ } else if (record.type === WebInspector.TimelineModel.RecordType.TimeStamp
+ || record.type === WebInspector.TimelineModel.RecordType.ConsoleTime) {
+ suffix = " : " + record.data.message;
+ }
+ if (detailsCallback)
+ suffix += " " + detailsCallback(record);
+ InspectorTest.addResult(prefix + InspectorTest._timelineAgentTypeToString(record.type) + suffix);
+
+ var numChildren = presentationRecord.presentationChildren() ? presentationRecord.presentationChildren().length : 0;
+ for (var i = 0; i < numChildren; ++i) {
+ if (filterTypes && filterTypes.indexOf(presentationRecord.presentationChildren()[i].record().type) == -1)
+ continue;
+ InspectorTest.dumpPresentationRecord(presentationRecord.presentationChildren()[i], detailsCallback, level + 1, filterTypes);
+ }
+}
+
InspectorTest.dumpTimelineRecords = function(timelineRecords)
{
for (var i = 0; i < timelineRecords.length; ++i)
@@ -180,6 +208,8 @@ InspectorTest.printTimelineRecordProperties = function(record)
{
InspectorTest.addResult(InspectorTest._timelineAgentTypeToString(record.type) + " Properties:");
// Use this recursive routine to print the properties
+ if (record instanceof WebInspector.TimelineModel.Record)
+ record = record._record;
InspectorTest.addObject(record, InspectorTest.timelinePropertyFormatters);
};
@@ -202,8 +232,7 @@ InspectorTest.findPresentationRecord = function(type)
result = record;
return true;
}
- var records = WebInspector.panel("timeline")._currentViews[0]._rootRecord().children;
- WebInspector.TimelinePresentationModel.forAllRecords(records, findByType);
+ WebInspector.panel("timeline")._model.forAllRecords(findByType);
return result;
}
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/websocket/timeline-websocket-event.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698