Bug 1452138 [wpt PR 9980] - Web Animations: Early-exit from setCurrentTime if new time is null, a=testonly
authorStephen McGruer <smcgruer@chromium.org>
Mon, 09 Apr 2018 16:33:35 +0000
changeset 413479 64dea8aab980a6df6cfc3fb9644f7255ec2bd905
parent 413478 e64205aeff2efb2c164d4936d145324771a43d5a
child 413480 84afb57ee4638fc678d5dd06bf68b8a70e7b2c29
push id33850
push userapavel@mozilla.com
push dateMon, 16 Apr 2018 09:53:48 +0000
treeherdermozilla-central@6276ec7ebbf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1452138, 818196, 946050, 542682
milestone61.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 1452138 [wpt PR 9980] - Web Animations: Early-exit from setCurrentTime if new time is null, a=testonly Automatic update from web-platform-testsWeb Animations: Early-exit from setCurrentTime if new time is null The spec says that setting the current time to null should throw if the existing currentTime is non-null, or do nothing otherwise. Bug: 818196 Change-Id: Iac89e46d6b884c924c88b603fbec77b61a337ce2 Reviewed-on: https://chromium-review.googlesource.com/946050 Reviewed-by: Xida Chen <xidachen@chromium.org> Commit-Queue: Stephen McGruer <smcgruer@chromium.org> Cr-Commit-Position: refs/heads/master@{#542682} wpt-commits: ae13e0657812995fed82c383c820036aeb03108a wpt-pr: 9980 wpt-commits: ae13e0657812995fed82c383c820036aeb03108a wpt-pr: 9980
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/web-animations/timing-model/animations/setting-the-current-time-of-an-animation.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -600613,17 +600613,17 @@
    "72b89e78ca7dac261af8de370389d89c810b3718",
    "testharness"
   ],
   "web-animations/timing-model/animations/seamlessly-updating-the-playback-rate-of-an-animation.html": [
    "a7e28aa0b40a39b00da257e347cb6ecf8d1d2882",
    "testharness"
   ],
   "web-animations/timing-model/animations/setting-the-current-time-of-an-animation.html": [
-   "a7da92b9624750eccb9dce1d32e522fdbb65176f",
+   "aa5f258132490ade2dbd9485c85f749cbab293a5",
    "testharness"
   ],
   "web-animations/timing-model/animations/setting-the-playback-rate-of-an-animation.html": [
    "b2698d9a829a1eadb3ef3b6d8e0050e7a6315305",
    "testharness"
   ],
   "web-animations/timing-model/animations/setting-the-start-time-of-an-animation.html": [
    "cf6040eb52964f12b06a9e3cdf14948ce8141270",
--- a/testing/web-platform/tests/web-animations/timing-model/animations/setting-the-current-time-of-an-animation.html
+++ b/testing/web-platform/tests/web-animations/timing-model/animations/setting-the-current-time-of-an-animation.html
@@ -6,16 +6,49 @@
 <script src='/resources/testharness.js'></script>
 <script src='/resources/testharnessreport.js'></script>
 <script src='../../testcommon.js'></script>
 <body>
 <div id='log'></div>
 <script>
 'use strict';
 
+test(t => {
+  const anim = new Animation();
+  assert_equals(anim.playState, 'idle');
+  assert_equals(anim.currentTime, null);
+
+  // This should not throw because the currentTime is already null.
+  anim.currentTime = null;
+}, 'Setting the current time of a pending animation to unresolved does not'
+   + ' throw a TypeError');
+
+promise_test(async t => {
+  const anim = createDiv(t).animate(null, 100 * MS_PER_SEC);
+  await anim.ready;
+
+  assert_greater_than_equal(anim.currentTime, 0);
+  assert_throws({ name: 'TypeError' }, () => {
+    anim.currentTime = null;
+  });
+}, 'Setting the current time of a playing animation to unresolved throws a'
+   + ' TypeError');
+
+promise_test(async t => {
+  const anim = createDiv(t).animate(null, 100 * MS_PER_SEC);
+  await anim.ready;
+  anim.pause();
+
+  assert_greater_than_equal(anim.currentTime, 0);
+  assert_throws({ name: 'TypeError' }, () => {
+    anim.currentTime = null;
+  });
+}, 'Setting the current time of a paused animation to unresolved throws a'
+   + ' TypeError');
+
 promise_test(async t => {
   const anim = createDiv(t).animate(null, 100 * MS_PER_SEC);
   await anim.ready;
   anim.pause();
 
   // We should be pause-pending now
   assert_true(anim.pending);
   assert_equals(anim.playState, 'paused');