Bug 1416966 - Test that there is a micro task checkpoint before requestAnimationFrame callbacks. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 12 Dec 2017 18:44:05 +0900
changeset 710849 2a925bd6c10b1411d63a4f66eaba3b8ad01babba
parent 710848 967f935affb32e87d80f4b42f79b57855c78aaf3
child 710850 988b561bd7bedf45847a13b46d6a0ee790549cdf
push id92911
push userhikezoe@mozilla.com
push dateTue, 12 Dec 2017 10:01:08 +0000
reviewersbirtles
bugs1416966
milestone59.0a1
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
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/web-animations/timing-model/timelines/timelines.html.ini
testing/web-platform/tests/web-animations/timing-model/timelines/timelines.html
--- 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>