| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> | 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script src="../../http/tests/inspector/timeline-test.js"></script> | 5 <script src="../../http/tests/inspector/timeline-test.js"></script> |
| 6 <script src="resources/timeline-data.js"></script> | 6 <script src="resources/timeline-data.js"></script> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 function test() | 9 function test() |
| 10 { | 10 { |
| 11 var timelineData = InspectorTest.timelineData(); | |
| 12 | |
| 13 var timeline = WebInspector.panels.timeline; | 11 var timeline = WebInspector.panels.timeline; |
| 14 timeline._onModeChanged(); | 12 timeline._onModeChanged(); |
| 15 timeline._currentViews[0]._automaticallySizeWindow = true; | 13 timeline._currentViews[0]._automaticallySizeWindow = true; |
| 16 | 14 |
| 17 function requestWindowTimesHook(startTime, endTime) | 15 function requestWindowTimesHook(startTime, endTime) |
| 18 { | 16 { |
| 19 if (startTime) | 17 if (startTime) |
| 20 InspectorTest.addResult("time delta: " + (endTime - startTime)); | 18 InspectorTest.addResult("time delta: " + (endTime - startTime)); |
| 21 } | 19 } |
| 22 | 20 |
| 23 timeline.requestWindowTimes = requestWindowTimesHook; | 21 timeline.requestWindowTimes = requestWindowTimesHook; |
| 24 var model = timeline._model; | 22 InspectorTest.loadTimeline(InspectorTest.timelineData()); |
| 25 | 23 |
| 26 function createFileReader(file, delegate) | |
| 27 { | |
| 28 return new InspectorTest.FakeFileReader(timelineData, delegate, timeline
._saveToFile.bind(timeline)); | |
| 29 } | |
| 30 | |
| 31 InspectorTest.override(model, "_createFileReader", createFileReader); | |
| 32 | |
| 33 model.loadFromFile({}, new WebInspector.Progress()); | |
| 34 InspectorTest.completeTest(); | 24 InspectorTest.completeTest(); |
| 35 } | 25 } |
| 36 | 26 |
| 37 </script> | 27 </script> |
| 38 </head> | 28 </head> |
| 39 | 29 |
| 40 <body onload="runTest()"> | 30 <body onload="runTest()"> |
| 41 <p> | 31 <p> |
| 42 Tests the TimelineFlameChart automatically sized window. | 32 Tests the TimelineFlameChart automatically sized window. |
| 43 </p> | 33 </p> |
| 44 | 34 |
| 45 </body> | 35 </body> |
| 46 </html> | 36 </html> |
| OLD | NEW |