Bug 1416966 - Test that there is a micro task checkpoint before requestAnimationFrame callbacks. r?birtles
The test intentionally uses async_test to avoid browser's awkward micro task
handling.
MozReview-Commit-ID: K5WzEML7D5M
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -576120,17 +576120,17 @@
"84bd0be22d6e250cfefd118d306b2790f67471cc",
"testharness"
],
"web-animations/timing-model/timelines/document-timelines.html": [
"bbe8a5565d88c5697170eba02be6858589383fdf",
"testharness"
],
"web-animations/timing-model/timelines/timelines.html": [
- "e0164509c7fd07ec9deec024d5d7e370c5e0d705",
+ "8f16dc524470d88f65dbae8c2e98a8a5dbba5465",
"testharness"
],
"web-nfc/OWNERS": [
"d42f3f15d00686bf5a5c7c69169ef5cf2554bd7b",
"support"
],
"web-nfc/idlharness.https.html": [
"83c52be8280bba314116ff1337028ea7835ddf43",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/web-animations/timing-model/timelines/timelines.html.ini
@@ -0,0 +1,4 @@
+[timelines.html]
+ [Performs a micro task checkpoint before requestAnimation callbacks]
+ expected: FAIL
+
--- a/testing/web-platform/tests/web-animations/timing-model/timelines/timelines.html
+++ b/testing/web-platform/tests/web-animations/timing-model/timelines/timelines.html
@@ -66,9 +66,22 @@ async_test(t => {
assert_equals(document.timeline.currentTime, firstRafTime,
'Timeline time should be the same');
});
t.done();
});
}, 'Timeline time should be the same for all RAF callbacks in an animation'
+ ' frame');
+async_test(t => {
+ const div = createDiv(t);
+ const animation = div.animate(null, 100 * MS_PER_SEC);
+
+ animation.ready.then(t.step_func(() => {
+ const readyTimelineTime = document.timeline.currentTime;
+ requestAnimationFrame(t.step_func_done(() => {
+ assert_equals(readyTimelineTime, document.timeline.currentTime,
+ 'There should be a microtask checkpoint');
+ }));
+ }));
+}, 'Performs a microtask checkpoint after updating timelins');
+
</script>