| 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 <style type="text/css"> |
| 5 #node.anim { |
| 6 animation: anim 0 ease-in-out; |
| 7 } |
| 8 |
| 9 @keyframes anim { |
| 10 from { |
| 11 width: 100px; |
| 12 } |
| 13 to { |
| 14 width: 200px; |
| 15 } |
| 16 } |
| 17 </style> |
| 4 <script> | 18 <script> |
| 5 | 19 |
| 6 var player; | |
| 7 | |
| 8 function startAnimation() | 20 function startAnimation() |
| 9 { | 21 { |
| 10 player = node.animate([{ width: "100px" }, { width: "200px" }], 2000); | 22 node.classList.add("anim"); |
| 11 } | |
| 12 | |
| 13 function cancelAnimation() | |
| 14 { | |
| 15 player.cancel(); | |
| 16 } | 23 } |
| 17 | 24 |
| 18 function test() | 25 function test() |
| 19 { | 26 { |
| 20 InspectorTest.eventHandler["Animation.animationCreated"] = onCreated; | 27 InspectorTest.eventHandler["Animation.animationCreated"] = onCreated; |
| 21 InspectorTest.eventHandler["Animation.animationCanceled"] = onCanceled; | |
| 22 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted; | 28 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted; |
| 23 InspectorTest.sendCommand("Animation.enable", {}); | 29 InspectorTest.sendCommand("Animation.enable", {}); |
| 24 InspectorTest.evaluateInPage("startAnimation()", function() {}); | 30 InspectorTest.evaluateInPage("startAnimation()", function() {}); |
| 25 | 31 |
| 26 function onCreated() | 32 function onCreated() |
| 27 { | 33 { |
| 28 InspectorTest.log("Animation created"); | 34 InspectorTest.log("Animation created"); |
| 29 } | 35 } |
| 30 | 36 |
| 31 function onStarted() | 37 function onStarted() |
| 32 { | 38 { |
| 33 InspectorTest.log("Animation started"); | 39 InspectorTest.log("Animation started"); |
| 34 InspectorTest.evaluateInPage("cancelAnimation()", function() {}); | |
| 35 } | |
| 36 | |
| 37 function onCanceled() | |
| 38 { | |
| 39 InspectorTest.log("Animation canceled"); | |
| 40 InspectorTest.completeTest(); | 40 InspectorTest.completeTest(); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 </script> | 44 </script> |
| 45 </head> | 45 </head> |
| 46 <body onload="runTest()"> | 46 <body onload="runTest()"> |
| 47 <div id="node" style="background-color: red; height: 100px"></div> | 47 <div id="node" style="background-color: red; width: 100px"></div> |
| 48 </body> | 48 </body> |
| 49 </html> | 49 </html> |
| OLD | NEW |