Bug 1528894 [wpt PR 15455] - [html] Add test that cancelAnimationFrame cancels a pending animation frame callback, a=testonly
authorBrian Birtles <birtles@gmail.com>
Wed, 06 Mar 2019 10:34:30 +0000
changeset 464601 52a879d4e479
parent 464600 22cd2b24f924
child 464602 0069fc96bbdf
push id35717
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:45:26 +0000
treeherdermozilla-central@e0861be8d6c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1528894, 15455
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1528894 [wpt PR 15455] - [html] Add test that cancelAnimationFrame cancels a pending animation frame callback, a=testonly Automatic update from web-platform-tests HTML: cancelAnimationFrame cancels a pending animation frame callback For https://github.com/whatwg/html/pull/4375. -- wpt-commits: bbbe615d3f5b7b44ed49b4b369f19d4c5dd32e53 wpt-pr: 15455
testing/web-platform/tests/html/webappapis/animation-frames/cancel-pending.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/webappapis/animation-frames/cancel-pending.html
@@ -0,0 +1,26 @@
+<!doctype html>
+<title>cancelAnimationFrame cancels a pending animation frame callback</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#run-the-animation-frame-callbacks">
+<div id="log"></div>
+<script>
+async_test(t => {
+  let didCall = false;
+
+  function callbackOne() {
+    cancelAnimationFrame(twoHandle);
+    requestAnimationFrame(t.step_func(() => {
+      assert_false(didCall, 'Should NOT have called the second callback');
+      t.done();
+    }));
+  }
+
+  function callbackTwo() {
+    didCall = true;
+  }
+
+  requestAnimationFrame(callbackOne);
+  const twoHandle = requestAnimationFrame(callbackTwo);
+}, 'cancelAnimationFrame cancels a pending animation frame callback');
+</script>