Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / timeline / timeline-auto-record.html
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script src="../../http/tests/inspector/timeline-test.js"></script>
6 <script>
7
8 function test()
9 {
10     var panel = WebInspector.panels.timeline
11     var model = panel._model;
12
13     var callbackBarrier = new CallbackBarrier();
14     model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted, recordingStarted);
15     model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped, callbackBarrier.createCallback());
16
17     WebInspector.ConsolePanel.show("console");
18     InspectorTest.runWhenPageLoads(step1);
19     InspectorTest.addResult("Reloading page on console panel");
20     WebInspector.resourceTreeModel.reloadPage();
21
22     function step1()
23     {
24         WebInspector.TimelinePanel.show();
25         InspectorTest.runWhenPageLoads(callbackBarrier.createCallback());
26         callbackBarrier.callWhenDone(recordingStopped);
27         InspectorTest.addResult("Reloading page on timeline panel");
28         WebInspector.resourceTreeModel.reloadPage();
29     }
30
31     function recordingStarted()
32     {
33         InspectorTest.addResult("Recording started");
34         InspectorTest.addResult("Initiated by user: " + model._clientInitiatedRecording);
35     }
36
37     function recordingStopped()
38     {
39         InspectorTest.addResult("Recording stopped");
40         InspectorTest.completeTest();
41     }
42 }
43
44 </script>
45 </head>
46
47 <body onload="runTest()">
48 <p>Test auto-recording of Timeline.</p>
49
50 </body>
51 </html>