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.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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 for (var i = 0; i < level ; ++i) | 162 for (var i = 0; i < level ; ++i) |
163 prefix = "----" + prefix; | 163 prefix = "----" + prefix; |
164 if (level > 0) | 164 if (level > 0) |
165 prefix = prefix + "> "; | 165 prefix = prefix + "> "; |
166 if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp | 166 if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp |
167 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime)
{ | 167 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime)
{ |
168 suffix = " : " + record.data().message; | 168 suffix = " : " + record.data().message; |
169 } | 169 } |
170 if (detailsCallback) | 170 if (detailsCallback) |
171 suffix += " " + detailsCallback(record); | 171 suffix += " " + detailsCallback(record); |
172 InspectorTest.addResult(prefix + InspectorTest._timelineAgentTypeToString(re
cord.type()) + suffix); | 172 InspectorTest.addResult(prefix + record.type() + suffix); |
173 | 173 |
174 var children = record.children(); | 174 var children = record.children(); |
175 var numChildren = children.length; | 175 var numChildren = children.length; |
176 for (var i = 0; i < numChildren; ++i) { | 176 for (var i = 0; i < numChildren; ++i) { |
177 if (filterTypes && filterTypes.indexOf(children[i].type()) == -1) | 177 if (filterTypes && filterTypes.indexOf(children[i].type()) == -1) |
178 continue; | 178 continue; |
179 InspectorTest.dumpTimelineRecord(children[i], detailsCallback, level + 1
, filterTypes); | 179 InspectorTest.dumpTimelineRecord(children[i], detailsCallback, level + 1
, filterTypes); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
(...skipping 26 matching lines...) Expand all Loading... |
209 if (level > 0) | 209 if (level > 0) |
210 prefix = prefix + "> "; | 210 prefix = prefix + "> "; |
211 if (presentationRecord.coalesced()) { | 211 if (presentationRecord.coalesced()) { |
212 suffix = " x " + presentationRecord.presentationChildren().length; | 212 suffix = " x " + presentationRecord.presentationChildren().length; |
213 } else if (record && (record.type() === WebInspector.TimelineModel.RecordTyp
e.TimeStamp | 213 } else if (record && (record.type() === WebInspector.TimelineModel.RecordTyp
e.TimeStamp |
214 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime))
{ | 214 || record.type() === WebInspector.TimelineModel.RecordType.ConsoleTime))
{ |
215 suffix = " : " + record.data().message; | 215 suffix = " : " + record.data().message; |
216 } | 216 } |
217 if (detailsCallback) | 217 if (detailsCallback) |
218 suffix += " " + detailsCallback(presentationRecord); | 218 suffix += " " + detailsCallback(presentationRecord); |
219 var typeString = record ? InspectorTest._timelineAgentTypeToString(record.ty
pe()) : "Root"; | 219 var typeString = record ? record.type() : "Root"; |
220 InspectorTest.addResult(prefix + typeString + suffix); | 220 InspectorTest.addResult(prefix + typeString + suffix); |
221 | 221 |
222 var numChildren = presentationRecord.presentationChildren() ? presentationRe
cord.presentationChildren().length : 0; | 222 var numChildren = presentationRecord.presentationChildren() ? presentationRe
cord.presentationChildren().length : 0; |
223 for (var i = 0; i < numChildren; ++i) { | 223 for (var i = 0; i < numChildren; ++i) { |
224 if (filterTypes && filterTypes.indexOf(presentationRecord.presentationCh
ildren()[i].record().type()) == -1) | 224 if (filterTypes && filterTypes.indexOf(presentationRecord.presentationCh
ildren()[i].record().type()) == -1) |
225 continue; | 225 continue; |
226 InspectorTest.dumpPresentationRecord(presentationRecord.presentationChil
dren()[i], detailsCallback, level + 1, filterTypes); | 226 InspectorTest.dumpPresentationRecord(presentationRecord.presentationChil
dren()[i], detailsCallback, level + 1, filterTypes); |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 InspectorTest.dumpTimelineRecords = function(timelineRecords) | 230 InspectorTest.dumpTimelineRecords = function(timelineRecords) |
231 { | 231 { |
232 for (var i = 0; i < timelineRecords.length; ++i) | 232 for (var i = 0; i < timelineRecords.length; ++i) |
233 InspectorTest.dumpTimelineRecord(timelineRecords[i], 0); | 233 InspectorTest.dumpTimelineRecord(timelineRecords[i], 0); |
234 }; | 234 }; |
235 | 235 |
236 InspectorTest.printTimelineRecordProperties = function(record) | 236 InspectorTest.printTimelineRecordProperties = function(record) |
237 { | 237 { |
238 var recordType = (typeof record.type === "string") ? record.type : record.ty
pe(); | 238 InspectorTest.addResult(record.type() + " Properties:"); |
239 InspectorTest.addResult(InspectorTest._timelineAgentTypeToString(recordType)
+ " Properties:"); | |
240 // Use this recursive routine to print the properties | 239 // Use this recursive routine to print the properties |
241 if (record instanceof WebInspector.TimelineModel.RecordImpl) | 240 if (record instanceof WebInspector.TimelineModel.RecordImpl) |
242 record = record._record; | 241 record = record._record; |
243 InspectorTest.addObject(record, InspectorTest.timelinePropertyFormatters); | 242 InspectorTest.addObject(record, InspectorTest.timelinePropertyFormatters); |
244 }; | 243 }; |
245 | 244 |
246 InspectorTest._timelineAgentTypeToString = function(numericType) | |
247 { | |
248 for (var prop in WebInspector.TimelineModel.RecordType) { | |
249 if (WebInspector.TimelineModel.RecordType[prop] === numericType) | |
250 return prop; | |
251 } | |
252 return undefined; | |
253 }; | |
254 | |
255 InspectorTest.findFirstTimelineRecord = function(type) | 245 InspectorTest.findFirstTimelineRecord = function(type) |
256 { | 246 { |
257 var result; | 247 var result; |
258 function findByType(record) | 248 function findByType(record) |
259 { | 249 { |
260 if (record.type() !== type) | 250 if (record.type() !== type) |
261 return false; | 251 return false; |
262 result = record; | 252 result = record; |
263 return true; | 253 return true; |
264 } | 254 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 return this._fileSize; | 322 return this._fileSize; |
333 }, | 323 }, |
334 | 324 |
335 fileName: function() | 325 fileName: function() |
336 { | 326 { |
337 return "fakeFile"; | 327 return "fakeFile"; |
338 } | 328 } |
339 }; | 329 }; |
340 | 330 |
341 }; | 331 }; |
OLD | NEW |