Commit d4a2a40b authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

DevTools: await the result of protocol messages in animation-release.js

Bug: 1028684
Change-Id: If579db7684970205d55a398016b55b889bb3e7bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1978748
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: default avatarMathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#728154}
parent 0a7d5573
......@@ -3,21 +3,23 @@
<div id='node' style='background-color: red; width: 100px'></div>
`, 'Tests that the animation is correctly paused.');
dp.Animation.enable();
session.evaluate(`
await dp.Animation.enable();
const animationStartedPromise = dp.Animation.onceAnimationStarted();
await session.evaluate(`
window.animation = node.animate([{ width: '100px' }, { width: '2000px' }], { duration: 0, fill: 'forwards' });
`);
var id = (await dp.Animation.onceAnimationStarted()).params.animation.id;
var id = (await animationStartedPromise).params.animation.id;
testRunner.log('Animation started');
var width = await session.evaluate('node.offsetWidth');
testRunner.log('Box is animating: ' + (width != 100).toString());
dp.Animation.setPaused({ animations: [ id ], paused: true });
session.evaluate('animation.cancel()');
await dp.Animation.setPaused({ animations: [ id ], paused: true });
await session.evaluate('animation.cancel()');
width = await session.evaluate('node.offsetWidth');
testRunner.log('Animation paused');
testRunner.log('Box is animating: ' + (width != 100).toString());
dp.Animation.releaseAnimations({ animations: [ id ] });
await dp.Animation.releaseAnimations({ animations: [ id ] });
width = await session.evaluate('node.offsetWidth');
testRunner.log('Animation released');
testRunner.log('Box is animating: ' + (width != 100).toString());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment