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

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

Issue 180273023: DevTools: encapsulate presentation model in timeline view. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review comments addressed. Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 var initialize_Timeline = function() { 1 var initialize_Timeline = function() {
2 2
3 // Scrub values when printing out these properties in the record or data field. 3 // Scrub values when printing out these properties in the record or data field.
4 InspectorTest.timelinePropertyFormatters = { 4 InspectorTest.timelinePropertyFormatters = {
5 children: "formatAsTypeName", 5 children: "formatAsTypeName",
6 endTime: "formatAsTypeName", 6 endTime: "formatAsTypeName",
7 requestId: "formatAsTypeName", 7 requestId: "formatAsTypeName",
8 startTime: "formatAsTypeName", 8 startTime: "formatAsTypeName",
9 stackTrace: "formatAsTypeName", 9 stackTrace: "formatAsTypeName",
10 url: "formatAsURL", 10 url: "formatAsURL",
(...skipping 16 matching lines...) Expand all
27 elementId: "formatAsTypeName", 27 elementId: "formatAsTypeName",
28 networkTime: "formatAsTypeName", 28 networkTime: "formatAsTypeName",
29 thread: "formatAsTypeName" 29 thread: "formatAsTypeName"
30 }; 30 };
31 31
32 InspectorTest.timelinePresentationModel = function() 32 InspectorTest.timelinePresentationModel = function()
33 { 33 {
34 return WebInspector.panels.timeline._currentViews[0]._presentationModel; 34 return WebInspector.panels.timeline._currentViews[0]._presentationModel;
35 } 35 }
36 36
37 InspectorTest.timelineModel = function()
38 {
39 return WebInspector.panels.timeline._model;
40 }
41
37 InspectorTest.startTimeline = function(callback) 42 InspectorTest.startTimeline = function(callback)
38 { 43 {
39 InspectorTest._timelineRecords = []; 44 InspectorTest._timelineRecords = [];
40 WebInspector.panel("timeline").toggleTimelineButton.toggled = true; 45 WebInspector.panel("timeline").toggleTimelineButton.toggled = true;
41 WebInspector.panel("timeline")._model._collectionEnabled = true; 46 WebInspector.panel("timeline")._model._collectionEnabled = true;
42 TimelineAgent.start(5, false, true, false, callback); 47 TimelineAgent.start(5, false, true, false, callback);
43 function addRecord(record) 48 function addRecord(record)
44 { 49 {
45 InspectorTest._timelineRecords.push(record); 50 InspectorTest._timelineRecords.push(record);
46 for (var i = 0; record.children && i < record.children.length; ++i) 51 for (var i = 0; record.children && i < record.children.length; ++i)
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 InspectorTest.evaluateWithTimeline(actions, callback) 126 InspectorTest.evaluateWithTimeline(actions, callback)
122 }; 127 };
123 128
124 InspectorTest.printTimelineRecords = function(typeName, formatter) 129 InspectorTest.printTimelineRecords = function(typeName, formatter)
125 { 130 {
126 InspectorTest.innerPrintTimelineRecords(InspectorTest._timelineRecords, type Name, formatter); 131 InspectorTest.innerPrintTimelineRecords(InspectorTest._timelineRecords, type Name, formatter);
127 }; 132 };
128 133
129 InspectorTest.printTimestampRecords = function(typeName, formatter) 134 InspectorTest.printTimestampRecords = function(typeName, formatter)
130 { 135 {
131 InspectorTest.innerPrintTimelineRecords(InspectorTest.timelinePresentationMo del().eventDividerRecords(), typeName, formatter); 136 InspectorTest.innerPrintTimelineRecords(InspectorTest.timelineModel().eventD ividerRecords(), typeName, formatter);
132 }; 137 };
133 138
134 InspectorTest.innerPrintTimelineRecords = function(records, typeName, formatter) 139 InspectorTest.innerPrintTimelineRecords = function(records, typeName, formatter)
135 { 140 {
136 for (var i = 0; i < records.length; ++i) { 141 for (var i = 0; i < records.length; ++i) {
137 if (typeName && records[i].type === WebInspector.TimelineModel.RecordTyp e[typeName]) 142 if (typeName && records[i].type === WebInspector.TimelineModel.RecordTyp e[typeName])
138 InspectorTest.printTimelineRecordProperties(records[i]); 143 InspectorTest.printTimelineRecordProperties(records[i]);
139 if (formatter) 144 if (formatter)
140 formatter(records[i]); 145 formatter(records[i]);
141 } 146 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 return this._fileSize; 286 return this._fileSize;
282 }, 287 },
283 288
284 fileName: function() 289 fileName: function()
285 { 290 {
286 return "fakeFile"; 291 return "fakeFile";
287 } 292 }
288 }; 293 };
289 294
290 }; 295 };
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/timeline/timeline-filtering.html » ('j') | Source/devtools/front_end/TimelinePanel.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698