| 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> | 6 <script> |
| 7 | 7 |
| 8 function test() | 8 function test() |
| 9 { | 9 { |
| 10 var panel = WebInspector.panels.timeline; | 10 var panel = WebInspector.panels.timeline; |
| 11 var model = panel._model; | 11 var model = panel._model; |
| 12 | 12 |
| 13 var callbackBarrier = new CallbackBarrier(); | 13 var callbackBarrier = new CallbackBarrier(); |
| 14 model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, r
ecordingStarted); | 14 model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, r
ecordingStarted); |
| 15 model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, c
allbackBarrier.createCallback()); | 15 model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, c
allbackBarrier.createCallback()); |
| 16 | 16 |
| 17 WebInspector.ConsolePanel.show(); | 17 WebInspector.ConsolePanel.show(); |
| 18 InspectorTest.runWhenPageLoads(step1); | 18 InspectorTest.runWhenPageLoads(step1); |
| 19 InspectorTest.addResult("Reloading page on console panel"); | 19 InspectorTest.addResult("Reloading page on console panel"); |
| 20 WebInspector.resourceTreeModel.reloadPage(); | 20 InspectorTest.resourceTreeModel.reloadPage(); |
| 21 | 21 |
| 22 function step1() | 22 function step1() |
| 23 { | 23 { |
| 24 WebInspector.TimelinePanel.show(); | 24 WebInspector.TimelinePanel.show(); |
| 25 InspectorTest.runWhenPageLoads(callbackBarrier.createCallback()); | 25 InspectorTest.runWhenPageLoads(callbackBarrier.createCallback()); |
| 26 callbackBarrier.callWhenDone(recordingStopped); | 26 callbackBarrier.callWhenDone(recordingStopped); |
| 27 InspectorTest.addResult("Reloading page on timeline panel"); | 27 InspectorTest.addResult("Reloading page on timeline panel"); |
| 28 WebInspector.resourceTreeModel.reloadPage(); | 28 InspectorTest.resourceTreeModel.reloadPage(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function recordingStarted() | 31 function recordingStarted() |
| 32 { | 32 { |
| 33 InspectorTest.addResult("Recording started"); | 33 InspectorTest.addResult("Recording started"); |
| 34 InspectorTest.addResult("Initiated by user: " + panel._userInitiatedReco
rding); | 34 InspectorTest.addResult("Initiated by user: " + panel._userInitiatedReco
rding); |
| 35 } | 35 } |
| 36 | 36 |
| 37 function recordingStopped() | 37 function recordingStopped() |
| 38 { | 38 { |
| 39 InspectorTest.addResult("Recording stopped"); | 39 InspectorTest.addResult("Recording stopped"); |
| 40 InspectorTest.completeTest(); | 40 InspectorTest.completeTest(); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 </script> | 44 </script> |
| 45 </head> | 45 </head> |
| 46 | 46 |
| 47 <body onload="runTest()"> | 47 <body onload="runTest()"> |
| 48 <p>Test auto-recording of Timeline.</p> | 48 <p>Test auto-recording of Timeline.</p> |
| 49 | 49 |
| 50 </body> | 50 </body> |
| 51 </html> | 51 </html> |
| OLD | NEW |