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

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

Issue 1353653003: DevTools: cleanup timeline concise record details generation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: re-uploading after blink repo merge 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
Index: third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
index 588e57d31d472a8a35e4922d2bdb88522187c6c3..f407d976d4a26e6a768a7502106b68cbb04411eb 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
@@ -145,7 +145,7 @@ InspectorTest.performActionsAndPrint = function(actions, typeName, includeTimeSt
{
function callback()
{
- InspectorTest.printTimelineRecords(typeName);
+ InspectorTest.printTimelineRecordsWithDetails(typeName);
if (includeTimeStamps) {
InspectorTest.addResult("Timestamp records: ");
InspectorTest.printTimestampRecords(typeName);
@@ -160,6 +160,25 @@ InspectorTest.printTimelineRecords = function(typeName, formatter)
InspectorTest.timelineModel().forAllRecords(InspectorTest._printTimlineRecord.bind(InspectorTest, typeName, formatter));
};
+InspectorTest.detailsTextForTraceEvent = function(traceEvent)
+{
+ return WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent(traceEvent,
+ WebInspector.targetManager.mainTarget(),
+ new WebInspector.Linkifier());
+}
+
+InspectorTest.printTimelineRecordsWithDetails = function(typeName)
+{
+ function detailsFormatter(recordType, record)
+ {
+ if (recordType && recordType !== record.type())
+ return;
+ InspectorTest.addResult("Text details for " + record.type() + ": " + InspectorTest.detailsTextForTraceEvent(record.traceEvent()));
+ }
+
+ InspectorTest.timelineModel().forAllRecords(InspectorTest._printTimlineRecord.bind(InspectorTest, typeName, detailsFormatter.bind(null, typeName)));
+};
+
InspectorTest.printTimelinePresentationRecords = function(typeName, formatter)
{
InspectorTest.innerPrintTimelinePresentationRecords(WebInspector.panels.timeline._model.records(), typeName, formatter);
@@ -184,7 +203,6 @@ InspectorTest._printTimlineRecord = function(typeName, formatter, record)
formatter(record);
};
-
InspectorTest.innerPrintTimelinePresentationRecords = function(records, typeName, formatter)
{
for (var i = 0; i < records.length; ++i) {

Powered by Google App Engine
This is Rietveld 408576698