Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 var initialize_Timeline = function() { | 1 var initialize_Timeline = function() { |
| 2 | 2 |
| 3 InspectorTest.preloadPanel("timeline"); | 3 InspectorTest.preloadPanel("timeline"); |
| 4 WebInspector.TempFile = InspectorTest.TempFileMock; | 4 WebInspector.TempFile = InspectorTest.TempFileMock; |
| 5 | 5 |
| 6 // Scrub values when printing out these properties in the record or data field. | 6 // Scrub values when printing out these properties in the record or data field. |
| 7 InspectorTest.timelinePropertyFormatters = { | 7 InspectorTest.timelinePropertyFormatters = { |
| 8 children: "formatAsTypeName", | 8 children: "formatAsTypeName", |
| 9 endTime: "formatAsTypeName", | 9 endTime: "formatAsTypeName", |
| 10 requestId: "formatAsTypeName", | 10 requestId: "formatAsTypeName", |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 | 276 |
| 277 InspectorTest.dumpTimelineRecords = function(timelineRecords) | 277 InspectorTest.dumpTimelineRecords = function(timelineRecords) |
| 278 { | 278 { |
| 279 for (var i = 0; i < timelineRecords.length; ++i) | 279 for (var i = 0; i < timelineRecords.length; ++i) |
| 280 InspectorTest.dumpTimelineRecord(timelineRecords[i], 0); | 280 InspectorTest.dumpTimelineRecord(timelineRecords[i], 0); |
| 281 }; | 281 }; |
| 282 | 282 |
| 283 InspectorTest.printTimelineRecordProperties = function(record) | 283 InspectorTest.printTimelineRecordProperties = function(record) |
| 284 { | 284 { |
| 285 InspectorTest.addResult(record.type() + " Properties:"); | 285 InspectorTest.addResult(record.type() + " Properties:"); |
| 286 var object = {}; | 286 var traceEvent = record.traceEvent(); |
| 287 var names = ["data", "endTime", "frameId", "stackTrace", "startTime", "threa d", "type"]; | 287 var data = traceEvent.args["beginData"] || traceEvent.args["data"]; |
| 288 for (var i = 0; i < names.length; i++) { | 288 var frameId = data && data["frame"]; |
| 289 var name = names[i]; | 289 var object = { |
| 290 var value = record[name].call(record); | 290 data: traceEvent.args["data"] || traceEvent.args, |
| 291 if (value) | 291 endTime: record.endTime(), |
| 292 object[name] = value; | 292 frameId: frameId, |
| 293 stackTrace: traceEvent.stackTrace, | |
| 294 startTime: record.startTime(), | |
| 295 thread: record.thread(), | |
| 296 type: record.type() | |
| 297 }; | |
| 298 for (var field in object) { | |
| 299 if (object[field] === null || object[field] === undefined) | |
|
yurys
2015/09/10 00:10:16
Can we get formatters to take care of this?
| |
| 300 delete object[field]; | |
| 293 } | 301 } |
| 294 if (record.children().length) | 302 if (record.children().length) |
| 295 object["children"] = []; | 303 object["children"] = []; |
| 296 if (!record.data()) | |
| 297 object["data"] = record.traceEvent().args; | |
| 298 InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters); | 304 InspectorTest.addObject(object, InspectorTest.timelinePropertyFormatters); |
| 299 }; | 305 }; |
| 300 | 306 |
| 301 InspectorTest.findFirstTimelineRecord = function(type) | 307 InspectorTest.findFirstTimelineRecord = function(type) |
| 302 { | 308 { |
| 303 return InspectorTest.findTimelineRecord(type, 0); | 309 return InspectorTest.findTimelineRecord(type, 0); |
| 304 } | 310 } |
| 305 | 311 |
| 306 // Find the (n+1)th timeline record of a specific type. | 312 // Find the (n+1)th timeline record of a specific type. |
| 307 InspectorTest.findTimelineRecord = function(type, n) | 313 InspectorTest.findTimelineRecord = function(type, n) |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 405 if (!--count) { | 411 if (!--count) { |
| 406 callback(); | 412 callback(); |
| 407 return; | 413 return; |
| 408 } | 414 } |
| 409 if (window.testRunner) | 415 if (window.testRunner) |
| 410 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window, makeFrame)); | 416 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window, makeFrame)); |
| 411 else | 417 else |
| 412 window.requestAnimationFrame(makeFrame); | 418 window.requestAnimationFrame(makeFrame); |
| 413 } | 419 } |
| 414 } | 420 } |
| OLD | NEW |