OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> |
4 <script> | 4 <script> |
5 | 5 |
6 var player; | 6 var player; |
7 | 7 |
8 function startAnimation() | 8 function startAnimation() |
9 { | 9 { |
10 player = node.animate([{ width: "100px" }, { width: "200px" }], 2000); | 10 player = node.animate([{ width: "100px" }, { width: "200px" }], 2000); |
11 } | 11 } |
12 | 12 |
13 function cancelAnimation() | 13 function cancelAnimation() |
14 { | 14 { |
15 player.cancel(); | 15 player.cancel(); |
16 } | 16 } |
17 | 17 |
18 | |
19 function test() | 18 function test() |
20 { | 19 { |
21 InspectorTest.eventHandler["Animation.animationCreated"] = onCreated; | 20 InspectorTest.eventHandler["Animation.animationCreated"] = onCreated; |
| 21 InspectorTest.eventHandler["Animation.animationCanceled"] = onCanceled; |
22 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted; | 22 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted; |
23 InspectorTest.sendCommand("Animation.enable", {}); | 23 InspectorTest.sendCommand("Animation.enable", {}); |
24 InspectorTest.evaluateInPage("startAnimation()", function() {}); | 24 InspectorTest.evaluateInPage("startAnimation()", function() {}); |
25 | 25 |
26 function onCreated() | 26 function onCreated() |
27 { | 27 { |
28 InspectorTest.log("Animation created"); | 28 InspectorTest.log("Animation created"); |
29 } | 29 } |
30 | 30 |
31 function onStarted() | 31 function onStarted() |
32 { | 32 { |
33 InspectorTest.log("Animation started"); | 33 InspectorTest.log("Animation started"); |
| 34 InspectorTest.evaluateInPage("cancelAnimation()", function() {}); |
| 35 } |
| 36 |
| 37 function onCanceled() |
| 38 { |
| 39 InspectorTest.log("Animation canceled"); |
34 InspectorTest.completeTest(); | 40 InspectorTest.completeTest(); |
35 } | 41 } |
36 } | 42 } |
37 | 43 |
38 </script> | 44 </script> |
39 </head> | 45 </head> |
40 <body onload="runTest()"> | 46 <body onload="runTest()"> |
41 <div id="node" style="background-color: red; height: 100px"></div> | 47 <div id="node" style="background-color: red; height: 100px"></div> |
42 </body> | 48 </body> |
43 </html> | 49 </html> |
OLD | NEW |