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 522498 52a879d4e479200bddbe0bf3ee6b4c28e7d220de
parent 522497 22cd2b24f92419b0e7630f40795dfadb87571c7b
child 522499 0069fc96bbdf915291209037eeed7b4d93520292
push id10871
push usercbrindusan@mozilla.com
push dateMon, 18 Mar 2019 15:49:32 +0000
treeherdermozilla-beta@018abdd16060 [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>