Update web-platform-tests to revision 6a665f63ae39b552f60b971f11c34b215861fcb3

This commit is contained in:
WPT Sync Bot 2020-03-19 08:20:52 +00:00 committed by Josh Matthews
parent 2b0a48f291
commit ee944e769d
119 changed files with 4924 additions and 556 deletions

View file

@ -26,7 +26,8 @@ promise_test(async t => {
div.style.animation = 'anim 100s';
const watcher = new EventWatcher(t, div, [ 'animationend',
'animationcancel' ]);
'animationcancel' ],
fastEventsTimeout);
const animation = div.getAnimations()[0];
await animation.ready;
@ -90,7 +91,8 @@ promise_test(async t => {
const div1 = addDiv(t);
const div2 = addDiv(t);
const watcher1 = new EventWatcher(t, div1, 'animationstart');
const watcher1 = new EventWatcher(t, div1, 'animationstart',
fastEventsTimeout);
// Watch |div2| as well to ensure it does *not* get events.
const watcher2 = new EventWatcher(t, div2, 'animationstart');
@ -114,7 +116,8 @@ promise_test(async t => {
const div = addDiv(t);
const watcher = new EventWatcher(t, div, [ 'animationstart',
'animationend',
'animationcancel' ]);
'animationcancel' ],
fastEventsTimeout);
div.style.animation = 'anim 100s';
const animation = div.getAnimations()[0];
animation.finish();

View file

@ -21,7 +21,8 @@ const setupAnimation = (t, animationStyle) => {
const watcher = new EventWatcher(t, div, [ 'animationstart',
'animationiteration',
'animationend',
'animationcancel' ]);
'animationcancel' ],
fastEventsTimeout);
const animation = div.getAnimations()[0];
return { animation, watcher, div };

View file

@ -191,6 +191,15 @@ function waitForAnimationFrames(frameCount, onFrame) {
});
}
/**
* Timeout function used for tests with EventWatchers when all animation events
* should be received on the next animation frame. If two frames pass before
* receiving the expected events, then we can immediate fail the test.
*/
function fastEventsTimeout() {
return waitForAnimationFrames(2);
};
/**
* Wrapper that takes a sequence of N animations and returns:
*