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/timeline-test.js"></script> | 4 <script src="../../http/tests/inspector/timeline-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function performActions(callback) | 7 function performActions(callback) |
8 { | 8 { |
9 var element = document.getElementById("animation"); | 9 var element = document.getElementById("animation"); |
10 var requestId = window.requestAnimationFrame(animationFrameCallback, element
); | 10 var requestId = window.requestAnimationFrame(animationFrameCallback, element
); |
11 function animationFrameCallback() | 11 function animationFrameCallback() |
12 { | 12 { |
13 window.cancelAnimationFrame(requestId); | 13 window.cancelAnimationFrame(requestId); |
14 callback(); | 14 if (callback) |
| 15 callback(); |
15 } | 16 } |
16 } | 17 } |
17 | 18 |
18 function test() | 19 function test() |
19 { | 20 { |
20 InspectorTest.invokeAsyncWithTimeline("performActions", finish); | 21 InspectorTest.invokeAsyncWithTimeline("performActions", finish); |
21 | 22 |
22 function finish() | 23 function finish() |
23 { | 24 { |
24 InspectorTest.printTimelineRecords("RequestAnimationFrame"); | 25 InspectorTest.printTimelineRecordsWithDetails("RequestAnimationFrame"); |
25 InspectorTest.printTimelineRecords("FireAnimationFrame"); | 26 InspectorTest.printTimelineRecordsWithDetails("FireAnimationFrame"); |
26 InspectorTest.printTimelineRecords("CancelAnimationFrame"); | 27 InspectorTest.printTimelineRecordsWithDetails("CancelAnimationFrame"); |
27 InspectorTest.completeTest(); | 28 InspectorTest.completeTest(); |
28 } | 29 } |
29 } | 30 } |
30 | 31 |
31 if (!window.testRunner) | 32 if (!window.testRunner) |
32 setTimeout(performActions, 2000); | 33 setTimeout(performActions, 2000); |
33 | 34 |
34 </script> | 35 </script> |
35 </head> | 36 </head> |
36 | 37 |
37 <body onload="runTest()"> | 38 <body onload="runTest()"> |
38 <p> | 39 <p> |
39 Tests the Timeline events for Animation Frame feature | 40 Tests the Timeline events for Animation Frame feature |
40 </p> | 41 </p> |
41 <div id="animation"> | 42 <div id="animation"> |
42 | 43 |
43 </div> | 44 </div> |
44 | 45 |
45 </body> | 46 </body> |
46 </html> | 47 </html> |
OLD | NEW |