OLD | NEW |
(Empty) | |
| 1 (async function(testRunner) { |
| 2 let {page, session, dp} = await testRunner.startHTML(` |
| 3 <div id='node' style='background-color: red; width: 100px'></div> |
| 4 `, ''); |
| 5 |
| 6 dp.Animation.onAnimationCreated(() => testRunner.log('Animation created')); |
| 7 dp.Animation.onAnimationStarted(() => testRunner.log('Animation started')); |
| 8 dp.Animation.onAnimationCanceled(() => { |
| 9 testRunner.log('Animation canceled') |
| 10 testRunner.completeTest(); |
| 11 }); |
| 12 dp.Animation.enable(); |
| 13 |
| 14 session.evaluate(` |
| 15 node.style.transition = '1s'; |
| 16 node.offsetTop; |
| 17 node.style.width = '200px'; |
| 18 node.offsetTop; |
| 19 // Deliberately delay for two RAFs, which causes the animation to start |
| 20 // before we cancel it by clearing the transition. |
| 21 window.requestAnimationFrame(function() { |
| 22 window.requestAnimationFrame(function() { |
| 23 node.style.transition = ''; |
| 24 }); |
| 25 }); |
| 26 `); |
| 27 }) |
OLD | NEW |