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

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

Issue 337023004: Don't create TimelineModel.RecordImpl in TimelinePresentationModel.js (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 6 years, 6 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
« no previous file with comments | « no previous file | LayoutTests/inspector/timeline/timeline-coalescing.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 for (var i = 0; i < numChildren; ++i) { 200 for (var i = 0; i < numChildren; ++i) {
201 if (filterTypes && filterTypes.indexOf(record.children[i].type) == -1) 201 if (filterTypes && filterTypes.indexOf(record.children[i].type) == -1)
202 continue; 202 continue;
203 InspectorTest.dumpTimelineRecord(record.children[i], detailsCallback, le vel + 1, filterTypes); 203 InspectorTest.dumpTimelineRecord(record.children[i], detailsCallback, le vel + 1, filterTypes);
204 } 204 }
205 } 205 }
206 206
207 // Dump just the record name, indenting output on separate lines for subrecords 207 // Dump just the record name, indenting output on separate lines for subrecords
208 InspectorTest.dumpPresentationRecord = function(presentationRecord, detailsCallb ack, level, filterTypes) 208 InspectorTest.dumpPresentationRecord = function(presentationRecord, detailsCallb ack, level, filterTypes)
209 { 209 {
210 var record = presentationRecord.record(); 210 var record = !presentationRecord.presentationParent() ? null : presentationR ecord.record();
211 if (typeof level !== "number") 211 if (typeof level !== "number")
212 level = 0; 212 level = 0;
213 var prefix = ""; 213 var prefix = "";
214 var suffix = ""; 214 var suffix = "";
215 for (var i = 0; i < level ; ++i) 215 for (var i = 0; i < level ; ++i)
216 prefix = "----" + prefix; 216 prefix = "----" + prefix;
217 if (level > 0) 217 if (level > 0)
218 prefix = prefix + "> "; 218 prefix = prefix + "> ";
219 if (presentationRecord.coalesced()) { 219 if (presentationRecord.coalesced()) {
220 suffix = " x " + presentationRecord.presentationChildren().length; 220 suffix = " x " + presentationRecord.presentationChildren().length;
221 } else if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp 221 } else if (record && (record.type() === WebInspector.TimelineModel.RecordTyp e.TimeStamp
222 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime) { 222 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime)) {
223 suffix = " : " + record.data().message; 223 suffix = " : " + record.data().message;
224 } 224 }
225 if (detailsCallback) 225 if (detailsCallback)
226 suffix += " " + detailsCallback(record); 226 suffix += " " + detailsCallback(presentationRecord);
227 InspectorTest.addResult(prefix + InspectorTest._timelineAgentTypeToString(re cord.type()) + suffix); 227 var typeString = record ? InspectorTest._timelineAgentTypeToString(record.ty pe()) : "Root";
228 InspectorTest.addResult(prefix + typeString + suffix);
228 229
229 var numChildren = presentationRecord.presentationChildren() ? presentationRe cord.presentationChildren().length : 0; 230 var numChildren = presentationRecord.presentationChildren() ? presentationRe cord.presentationChildren().length : 0;
230 for (var i = 0; i < numChildren; ++i) { 231 for (var i = 0; i < numChildren; ++i) {
231 if (filterTypes && filterTypes.indexOf(presentationRecord.presentationCh ildren()[i].record().type()) == -1) 232 if (filterTypes && filterTypes.indexOf(presentationRecord.presentationCh ildren()[i].record().type()) == -1)
232 continue; 233 continue;
233 InspectorTest.dumpPresentationRecord(presentationRecord.presentationChil dren()[i], detailsCallback, level + 1, filterTypes); 234 InspectorTest.dumpPresentationRecord(presentationRecord.presentationChil dren()[i], detailsCallback, level + 1, filterTypes);
234 } 235 }
235 } 236 }
236 237
237 InspectorTest.dumpTimelineRecords = function(timelineRecords) 238 InspectorTest.dumpTimelineRecords = function(timelineRecords)
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 return this._fileSize; 340 return this._fileSize;
340 }, 341 },
341 342
342 fileName: function() 343 fileName: function()
343 { 344 {
344 return "fakeFile"; 345 return "fakeFile";
345 } 346 }
346 }; 347 };
347 348
348 }; 349 };
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/timeline/timeline-coalescing.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698