Update web-platform-tests to revision 3cc9e82a7c1a53423097f3d581d4bfc185f56d18

This commit is contained in:
WPT Sync Bot 2020-08-08 08:21:32 +00:00
parent 589ab01be4
commit a3410e195f
133 changed files with 1534 additions and 5642 deletions

View file

@ -18,12 +18,14 @@
const setupAnimation = (t, animationStyle) => {
const div = addDiv(t, { style: 'animation: ' + animationStyle });
const animation = div.getAnimations()[0];
const timeoutPromise = armTimeoutWhenReady(animation, fastEventsTimeout);
const watcher = new EventWatcher(t, div, [ 'animationstart',
'animationiteration',
'animationend',
'animationcancel' ],
fastEventsTimeout);
const animation = div.getAnimations()[0];
timeoutPromise);
return { animation, watcher, div };
};

View file

@ -201,6 +201,21 @@ function fastEventsTimeout() {
return waitForAnimationFrames(2);
};
/**
* Timeout function used for tests with EventWatchers. The client agent has no
* strict requirement for how long it takes to resolve the ready promise. Once
* the promise is resolved a secondary timeout promise is armed that may have
* a tight deadline measured in animation frames.
*/
function armTimeoutWhenReady(animation, timeoutPromise) {
return () => {
if (animation.pending)
return animation.ready.then(() => { return timeoutPromise(); });
else
return timeoutPromise();
};
}
/**
* Wrapper that takes a sequence of N animations and returns:
*