OLD | NEW |
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.timelineNonDeterministicProps = { | 4 InspectorTest.timelineNonDeterministicProps = { |
5 children : 1, | 5 children : 1, |
6 endTime : 1, | 6 endTime : 1, |
7 height : 1, | 7 height : 1, |
8 requestId : 1, | 8 requestId : 1, |
9 startTime : 1, | 9 startTime : 1, |
10 width : 1, | 10 width : 1, |
(...skipping 13 matching lines...) Expand all Loading... |
24 { | 24 { |
25 InspectorTest._timelineRecords.push(record); | 25 InspectorTest._timelineRecords.push(record); |
26 for (var i = 0; record.children && i < record.children.length; ++i) | 26 for (var i = 0; record.children && i < record.children.length; ++i) |
27 addRecord(record.children[i]); | 27 addRecord(record.children[i]); |
28 } | 28 } |
29 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E
ventTypes.TimelineEventRecorded, function(event) { | 29 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E
ventTypes.TimelineEventRecorded, function(event) { |
30 addRecord(event.data); | 30 addRecord(event.data); |
31 }); | 31 }); |
32 }; | 32 }; |
33 | 33 |
| 34 |
| 35 InspectorTest.waitForRecordType = function(recordType, callback) |
| 36 { |
| 37 WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.E
ventTypes.TimelineEventRecorded, function(event) { |
| 38 addRecord(event.data); |
| 39 }); |
| 40 |
| 41 function addRecord(record) |
| 42 { |
| 43 if (record.type !== WebInspector.TimelineAgent.RecordType[recordType]) { |
| 44 for (var i = 0; record.children && i < record.children.length; ++i) |
| 45 addRecord(record.children[i]); |
| 46 return ; |
| 47 } |
| 48 callback(record); |
| 49 } |
| 50 } |
| 51 |
34 InspectorTest.stopTimeline = function(callback) | 52 InspectorTest.stopTimeline = function(callback) |
35 { | 53 { |
36 function didStop() | 54 function didStop() |
37 { | 55 { |
38 WebInspector.panels.timeline.toggleTimelineButton.toggled = false; | 56 WebInspector.panels.timeline.toggleTimelineButton.toggled = false; |
39 callback(InspectorTest._timelineRecords); | 57 callback(InspectorTest._timelineRecords); |
40 } | 58 } |
41 TimelineAgent.stop(didStop); | 59 TimelineAgent.stop(didStop); |
42 }; | 60 }; |
43 | 61 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 InspectorTest._timelineAgentTypeToString = function(numericType) | 127 InspectorTest._timelineAgentTypeToString = function(numericType) |
110 { | 128 { |
111 for (var prop in WebInspector.TimelineAgent.RecordType) { | 129 for (var prop in WebInspector.TimelineAgent.RecordType) { |
112 if (WebInspector.TimelineAgent.RecordType[prop] === numericType) | 130 if (WebInspector.TimelineAgent.RecordType[prop] === numericType) |
113 return prop; | 131 return prop; |
114 } | 132 } |
115 return undefined; | 133 return undefined; |
116 }; | 134 }; |
117 | 135 |
118 }; | 136 }; |
OLD | NEW |