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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 { | 380 { |
381 return this._fileSize; | 381 return this._fileSize; |
382 }, | 382 }, |
383 | 383 |
384 fileName: function() | 384 fileName: function() |
385 { | 385 { |
386 return "fakeFile"; | 386 return "fakeFile"; |
387 } | 387 } |
388 }; | 388 }; |
389 | 389 |
| 390 InspectorTest.loadTimeline = function(timelineData) |
| 391 { |
| 392 var timeline = WebInspector.panels.timeline; |
| 393 |
| 394 function createFileReader(file, delegate) |
| 395 { |
| 396 return new InspectorTest.FakeFileReader(timelineData, delegate, timeline
._saveToFile.bind(timeline)); |
| 397 } |
| 398 |
| 399 InspectorTest.override(WebInspector.TimelineLoader, "_createFileReader", cre
ateFileReader); |
| 400 WebInspector.TimelineLoader.loadFromFile(InspectorTest.timelineModel(), {},
new WebInspector.Progress()); |
| 401 } |
| 402 |
390 }; | 403 }; |
391 | 404 |
392 function generateFrames(count, callback) | 405 function generateFrames(count, callback) |
393 { | 406 { |
394 makeFrame(); | 407 makeFrame(); |
395 function makeFrame() | 408 function makeFrame() |
396 { | 409 { |
397 document.body.style.backgroundColor = count & 1 ? "rgb(200, 200, 200)" :
"rgb(240, 240, 240)"; | 410 document.body.style.backgroundColor = count & 1 ? "rgb(200, 200, 200)" :
"rgb(240, 240, 240)"; |
398 if (!--count) { | 411 if (!--count) { |
399 callback(); | 412 callback(); |
400 return; | 413 return; |
401 } | 414 } |
402 if (window.testRunner) | 415 if (window.testRunner) |
403 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window,
makeFrame)); | 416 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window,
makeFrame)); |
404 else | 417 else |
405 window.requestAnimationFrame(makeFrame); | 418 window.requestAnimationFrame(makeFrame); |
406 } | 419 } |
407 } | 420 } |
OLD | NEW |