gecko-dev/testing/web-platform/tests/web-animations/interfaces/Animation/pending.html
Olga Gerchikov 85821d52f1 Bug 1631850 [wpt PR 23145] - Initialize start time of scroll animations to zero., a=testonly
Automatic update from web-platform-tests
Initialize start time of scroll animations to zero.

Implemented web-animations-1 spec changes introduces in [1].

- Update play and pause procedures to initialize start time of scroll
  animations to zero.
- Updated calculate play state procedure to return "running" state for
  animations that has start time resolved.
- Added/modified tests reflecting spec changes.

[1] https://github.com/w3c/csswg-drafts/pull/4842

Bug: 1070637
Change-Id: Ic83995899b2f3f8d8f985f84b8a2b438bbad7c35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2150687
Commit-Queue: Olga Gerchikov <gerchiko@microsoft.com>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Reviewed-by: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#761974}

--

wpt-commits: 46978682c5d3e2ff08468be05564307a9a75e06b
wpt-pr: 23145
2020-04-28 11:41:34 +00:00

55 lines
1.6 KiB
HTML

<!DOCTYPE html>
<meta charset=utf-8>
<title>Animation.pending</title>
<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-pending">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../testcommon.js"></script>
<body>
<div id="log"></div>
<script>
'use strict';
promise_test(t => {
const div = createDiv(t);
const animation = div.animate({}, 100 * MS_PER_SEC);
assert_true(animation.pending);
return animation.ready.then(() => {
assert_false(animation.pending);
});
}, 'reports true -> false when initially played');
promise_test(t => {
const div = createDiv(t);
const animation = div.animate({}, 100 * MS_PER_SEC);
animation.pause();
assert_true(animation.pending);
return animation.ready.then(() => {
assert_false(animation.pending);
});
}, 'reports true -> false when paused');
promise_test(async t => {
const animation =
new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC),
null);
animation.play();
assert_true(animation.pending);
await waitForAnimationFrames(2);
assert_true(animation.pending);
}, 'reports true -> true when played without a timeline');
promise_test(async t => {
const animation =
new Animation(new KeyframeEffect(createDiv(t), null, 100 * MS_PER_SEC),
null);
animation.pause();
assert_true(animation.pending);
await waitForAnimationFrames(2);
assert_true(animation.pending);
}, 'reports true -> true when paused without a timeline');
</script>
</body>