Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / timeline / timeline-frames.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 performActions()
8 {
9     window.internals.emitInspectorDidBeginFrame();
10     console.timeStamp("FRAME 1");
11
12     window.internals.emitInspectorDidBeginFrame();
13     window.internals.emitInspectorDidCancelFrame();
14
15     window.internals.emitInspectorDidBeginFrame();
16     console.timeStamp("FRAME 2");
17     window.internals.emitInspectorDidCancelFrame();
18 }
19
20 function test()
21 {
22     function formatRecord(record)
23     {
24         if (record.type() === WebInspector.TimelineModel.RecordType.TimeStamp ||
25             record.type() === WebInspector.TimelineModel.RecordType.BeginFrame) {
26             InspectorTest.dumpTimelineRecord(record);
27         }
28     }
29
30     InspectorTest.startTimeline(function() {
31         InspectorTest.evaluateInPage("performActions()", step2);
32     });
33
34     function step2()
35     {
36         InspectorTest.stopTimeline(finish);
37     }
38
39     function finish()
40     {
41         InspectorTest.printTimelineRecords(null, formatRecord);
42         InspectorTest.completeTest();
43     }
44 }
45
46 </script>
47 </head>
48
49 <body onload="runTest()">
50 <p>
51 Tests reporting and canceling of didBeginFrame events in Timeline
52 </p>
53
54 </body>
55 </html>