mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Update web-platform-tests to revision 3cc9e82a7c1a53423097f3d581d4bfc185f56d18
This commit is contained in:
parent
589ab01be4
commit
a3410e195f
133 changed files with 1534 additions and 5642 deletions
|
@ -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 };
|
||||
};
|
||||
|
|
|
@ -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:
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue