Bug 1528894 [wpt PR 15455] - [html] Add test that cancelAnimationFrame cancels a pending animation frame callback, a=testonly
☠☠ backed out by 66b1aba3fb43 ☠ ☠
authorBrian Birtles <birtles@gmail.com>
Wed, 06 Mar 2019 10:34:30 +0000
changeset 464267 e7d92d3120c423087b25c70bdcd4c3696ae078a5
parent 464266 f7d636225ed1b5769a64878c13f5b253161dff19
child 464268 8080b1f6eef260ed463356e781f2b243e7d5dc35
push id35713
push usercbrindusan@mozilla.com
push dateFri, 15 Mar 2019 21:55:43 +0000
treeherdermozilla-central@66b1aba3fb43 [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>