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