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 | |
403 }; | 390 }; |
404 | 391 |
405 function generateFrames(count, callback) | 392 function generateFrames(count, callback) |
406 { | 393 { |
407 makeFrame(); | 394 makeFrame(); |
408 function makeFrame() | 395 function makeFrame() |
409 { | 396 { |
410 document.body.style.backgroundColor = count & 1 ? "rgb(200, 200, 200)" :
"rgb(240, 240, 240)"; | 397 document.body.style.backgroundColor = count & 1 ? "rgb(200, 200, 200)" :
"rgb(240, 240, 240)"; |
411 if (!--count) { | 398 if (!--count) { |
412 callback(); | 399 callback(); |
413 return; | 400 return; |
414 } | 401 } |
415 if (window.testRunner) | 402 if (window.testRunner) |
416 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window,
makeFrame)); | 403 testRunner.capturePixelsAsyncThen(requestAnimationFrame.bind(window,
makeFrame)); |
417 else | 404 else |
418 window.requestAnimationFrame(makeFrame); | 405 window.requestAnimationFrame(makeFrame); |
419 } | 406 } |
420 } | 407 } |
OLD | NEW |