| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto
r-protocol-test.js"></script> | |
| 4 <script> | |
| 5 | |
| 6 function triggerEmptyTransition() | |
| 7 { | |
| 8 node.style.transition = "1s"; | |
| 9 node.offsetTop; | |
| 10 node.style.width = "200px"; | |
| 11 node.offsetTop; | |
| 12 // Deliberately delay for two RAFs, which causes the animation to start | |
| 13 // before we cancel it by clearing the transition. | |
| 14 window.requestAnimationFrame(function() { | |
| 15 window.requestAnimationFrame(function() { | |
| 16 node.style.transition = ""; | |
| 17 }); | |
| 18 }); | |
| 19 } | |
| 20 | |
| 21 function test() | |
| 22 { | |
| 23 InspectorTest.eventHandler["Animation.animationCreated"] = onCreated; | |
| 24 InspectorTest.eventHandler["Animation.animationStarted"] = onStarted; | |
| 25 InspectorTest.eventHandler["Animation.animationCanceled"] = onCanceled; | |
| 26 InspectorTest.sendCommand("Animation.enable", {}); | |
| 27 InspectorTest.evaluateInPage("triggerEmptyTransition()", function() {}); | |
| 28 | |
| 29 function onCreated() | |
| 30 { | |
| 31 InspectorTest.log("Animation created"); | |
| 32 } | |
| 33 | |
| 34 function onStarted() | |
| 35 { | |
| 36 InspectorTest.log("Animation started"); | |
| 37 } | |
| 38 | |
| 39 function onCanceled() | |
| 40 { | |
| 41 InspectorTest.log("Animation canceled"); | |
| 42 InspectorTest.completeTest(); | |
| 43 } | |
| 44 } | |
| 45 | |
| 46 </script> | |
| 47 </head> | |
| 48 <body onload="runTest()"> | |
| 49 <div id="node" style="background-color: red; width: 100px"></div> | |
| 50 </body> | |
| 51 </html> | |
| OLD | NEW |