| OLD | NEW |
| 1 var initialize_Timeline = function() { | 1 var initialize_Timeline = function() { |
| 2 | 2 |
| 3 InspectorTest.preloadPanel("timeline"); | 3 InspectorTest.preloadPanel("timeline"); |
| 4 | 4 |
| 5 // Scrub values when printing out these properties in the record or data field. | 5 // Scrub values when printing out these properties in the record or data field. |
| 6 InspectorTest.timelinePropertyFormatters = { | 6 InspectorTest.timelinePropertyFormatters = { |
| 7 children: "formatAsTypeName", | 7 children: "formatAsTypeName", |
| 8 endTime: "formatAsTypeName", | 8 endTime: "formatAsTypeName", |
| 9 requestId: "formatAsTypeName", | 9 requestId: "formatAsTypeName", |
| 10 startTime: "formatAsTypeName", | 10 startTime: "formatAsTypeName", |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 273 } |
| 274 if (record.children().length) | 274 if (record.children().length) |
| 275 object["children"] = []; | 275 object["children"] = []; |
| 276 if (!record.data() && record instanceof WebInspector.TracingTimelineModel.Tr
aceEventRecord) | 276 if (!record.data() && record instanceof WebInspector.TracingTimelineModel.Tr
aceEventRecord) |
| 277 object["data"] = record.traceEvent().args; | 277 object["data"] = record.traceEvent().args; |
| 278 InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters); | 278 InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters); |
| 279 }; | 279 }; |
| 280 | 280 |
| 281 InspectorTest.findFirstTimelineRecord = function(type) | 281 InspectorTest.findFirstTimelineRecord = function(type) |
| 282 { | 282 { |
| 283 return InspectorTest.findTimelineRecord(type, 0); |
| 284 } |
| 285 |
| 286 // Find the (n+1)th timeline record of a specific type. |
| 287 InspectorTest.findTimelineRecord = function(type, n) |
| 288 { |
| 283 var result; | 289 var result; |
| 284 function findByType(record) | 290 function findByType(record) |
| 285 { | 291 { |
| 286 if (record.type() !== type) | 292 if (record.type() !== type) |
| 287 return false; | 293 return false; |
| 288 result = record; | 294 if (n === 0) { |
| 289 return true; | 295 result = record; |
| 296 return true; |
| 297 } |
| 298 n--; |
| 299 return false; |
| 290 } | 300 } |
| 291 InspectorTest.timelineModel().forAllRecords(findByType); | 301 InspectorTest.timelineModel().forAllRecords(findByType); |
| 292 return result; | 302 return result; |
| 293 } | 303 } |
| 294 | 304 |
| 295 InspectorTest.FakeFileReader = function(input, delegate, callback) | 305 InspectorTest.FakeFileReader = function(input, delegate, callback) |
| 296 { | 306 { |
| 297 this._delegate = delegate; | 307 this._delegate = delegate; |
| 298 this._callback = callback; | 308 this._callback = callback; |
| 299 this._input = input; | 309 this._input = input; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 return this._fileSize; | 368 return this._fileSize; |
| 359 }, | 369 }, |
| 360 | 370 |
| 361 fileName: function() | 371 fileName: function() |
| 362 { | 372 { |
| 363 return "fakeFile"; | 373 return "fakeFile"; |
| 364 } | 374 } |
| 365 }; | 375 }; |
| 366 | 376 |
| 367 }; | 377 }; |
| OLD | NEW |