Update web-platform-tests to revision e87f38097902e16348d4e17f4fe3bc2d0112bff1

This commit is contained in:
WPT Sync Bot 2018-03-17 21:12:30 -04:00
parent 2f8fa32e91
commit db5631a086
381 changed files with 11610 additions and 4232 deletions

View file

@ -22,7 +22,7 @@ function assert_phase_at_time(animation, phase, currentTime) {
if (phase === 'active') {
// If the fill mode is 'none', then progress will only be non-null if we
// are in the active phase.
animation.effect.timing.fill = 'none';
animation.effect.updateTiming({ fill: 'none' });
assert_not_equals(animation.effect.getComputedTiming().progress, null,
'Animation effect is in active phase when current time'
+ ` is ${currentTime}ms`);
@ -31,15 +31,15 @@ function assert_phase_at_time(animation, phase, currentTime) {
// phase is to toggle the fill mode. For example, if the progress is null
// will the fill node is 'none' but non-null when the fill mode is
// 'backwards' then we are in the before phase.
animation.effect.timing.fill = 'none';
animation.effect.updateTiming({ fill: 'none' });
assert_equals(animation.effect.getComputedTiming().progress, null,
`Animation effect is in ${phase} phase when current time`
+ ` is ${currentTime}ms`
+ ' (progress is null with \'none\' fill mode)');
animation.effect.timing.fill = phase === 'before'
? 'backwards'
: 'forwards';
animation.effect.updateTiming({
fill: phase === 'before' ? 'backwards' : 'forwards',
});
assert_not_equals(animation.effect.getComputedTiming().progress, null,
`Animation effect is in ${phase} phase when current time`
+ ` is ${currentTime}ms`

View file

@ -196,7 +196,7 @@ promise_test(async t => {
}, 'Finishing an animation resolves the finished promise synchronously');
promise_test(async t => {
const effect = new KeyframeEffectReadOnly(null, null, 100 * MS_PER_SEC);
const effect = new KeyframeEffect(null, null, 100 * MS_PER_SEC);
const animation = new Animation(effect, document.timeline);
let resolvedFinished = false;
animation.finished.then(() => {

View file

@ -36,9 +36,9 @@ promise_test(async t => {
anim.pause();
assert_true(anim.pending);
anim.effect = new KeyframeEffectReadOnly(createDiv(t),
{ marginLeft: [ '0px', '100px' ] },
100 * MS_PER_SEC);
anim.effect = new KeyframeEffect(createDiv(t),
{ marginLeft: [ '0px', '100px' ] },
100 * MS_PER_SEC);
assert_true(anim.pending);
await anim.ready;
@ -52,9 +52,9 @@ promise_test(async t => {
anim.play();
assert_true(anim.pending);
anim.effect = new KeyframeEffectReadOnly(createDiv(t),
{ marginLeft: [ '0px', '100px' ] },
100 * MS_PER_SEC);
anim.effect = new KeyframeEffect(createDiv(t),
{ marginLeft: [ '0px', '100px' ] },
100 * MS_PER_SEC);
assert_true(anim.pending);
await anim.ready;

View file

@ -141,7 +141,9 @@ promise_test(async t => {
'Hold time is initially set');
// Then extend the duration so that the hold time is cleared and on
// the next tick the current time will increase.
anim.effect.timing.duration *= 2;
anim.effect.updateTiming({
duration: anim.effect.getComputedTiming().duration * 2,
});
await waitForNextFrame();
assert_greater_than(anim.currentTime, 100 * MS_PER_SEC,
@ -247,7 +249,7 @@ promise_test(async t => {
anim.cancel();
// Trigger a change that will cause the "update the finished state"
// procedure to run.
anim.effect.timing.duration = 200 * MS_PER_SEC;
anim.effect.updateTiming({ duration: 200 * MS_PER_SEC });
assert_equals(anim.currentTime, null,
'The animation hold time / start time should not be updated');
// The "update the finished state" procedure is supposed to run after any
@ -273,7 +275,7 @@ test(t => {
// is greater than the target end. At this point the "update the finished
// state" procedure should run and if we fail to check for a pending task
// we will set the hold time to the target end, i.e. 50ms.
anim.effect.timing.duration = 50 * MS_PER_SEC;
anim.effect.updateTiming({ duration: 50 * MS_PER_SEC });
assert_equals(anim.currentTime, 75 * MS_PER_SEC,
'Hold time should not be updated');
}, 'Updating the finished state when there is a pending task');
@ -289,7 +291,7 @@ promise_test(async t => {
anim.currentTime = 150 * MS_PER_SEC;
// Trigger a change that will cause the "update the finished state"
// procedure to run (did seek = false).
anim.effect.timing.duration = 200 * MS_PER_SEC;
anim.effect.updateTiming({ duration: 200 * MS_PER_SEC });
await waitForAnimationFrames(1);
assert_equals(anim.currentTime, 150 * MS_PER_SEC,
@ -348,7 +350,7 @@ promise_test(async t => {
}, 'Finish notification steps run when the animation completes normally');
promise_test(async t => {
const effect = new KeyframeEffectReadOnly(null, null, 1);
const effect = new KeyframeEffect(null, null, 1);
const animation = new Animation(effect, document.timeline);
animation.play();
await animation.ready;
@ -417,5 +419,38 @@ async_test(t => {
};
}, 'Animation finish event is fired again after replaying from start');
async_test(t => {
const anim = createDiv(t).animate(null,
{ duration: 100000, endDelay: 50000 });
anim.onfinish = t.step_func(event => {
assert_unreached('finish event should not be fired');
});
anim.ready.then(() => {
anim.currentTime = 100000;
return waitForAnimationFrames(2);
}).then(t.step_func(() => {
t.done();
}));
}, 'finish event is not fired at the end of the active interval when the'
+ ' endDelay has not expired');
async_test(t => {
const anim = createDiv(t).animate(null,
{ duration: 100000, endDelay: 30000 });
anim.ready.then(() => {
anim.currentTime = 110000; // during endDelay
anim.onfinish = t.step_func(event => {
assert_unreached('onfinish event should not be fired during endDelay');
});
return waitForAnimationFrames(2);
}).then(t.step_func(() => {
anim.onfinish = t.step_func(event => {
t.done();
});
anim.currentTime = 130000; // after endTime
}));
}, 'finish event is fired after the endDelay has expired');
</script>
</body>