Bug 1529712 [wpt PR 15400] - [Animation Worklet] Upstream web tests (related to non-accelerated properties) to WPT, a=testonly
authorJordan Taylor <jortaylo@microsoft.com>
Tue, 05 Mar 2019 12:18:18 +0000
changeset 464244 3482165521245310e88ef5f6bb4402b710eb01f1
parent 464243 106ac73457aa2db68d9bc122b278e05991c432cd
child 464245 788727cccd4f582d0a8aaae485aed5be3999beda
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
bugs1529712, 15400, 915352, 1474634, 632770
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 1529712 [wpt PR 15400] - [Animation Worklet] Upstream web tests (related to non-accelerated properties) to WPT, a=testonly Automatic update from web-platform-tests [Animation Worklet] Upstream web tests (related to non-accelerated properties) to WPT web_tests/animations/animationworklet/animate-non-accelerated-property.html -> web_tests/external/wpt/animation-worklet/animate-non-accelerated-property.https.html web_tests/animations/animationworklet/cancel-non-accelerated-property.html -> web_tests/external/wpt/animation-worklet/cancel-non-accelerated-property.https.html Bug: 915352 Change-Id: I7ec16782489a9747920f6e93aa0fab749e25fbe8 Reviewed-on: https://chromium-review.googlesource.com/c/1474634 Commit-Queue: Jordan Taylor <jortaylo@microsoft.com> Reviewed-by: Yi Gu <yigu@chromium.org> Reviewed-by: Majid Valipour <majidvp@chromium.org> Cr-Commit-Position: refs/heads/master@{#632770} -- wpt-commits: e60392068706aa5e9674bfb750b254b70cac1084 wpt-pr: 15400
testing/web-platform/tests/animation-worklet/animate-non-accelerated-property.https.html
testing/web-platform/tests/animation-worklet/cancel-non-accelerated-property.https.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/animation-worklet/animate-non-accelerated-property.https.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Animate non-accelerated property using worklet animation</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/web-animations/testcommon.js"></script>
+<script src="common.js"></script>
+
+<div id="target"></div>
+<div id="target2"></div>
+
+<script>
+  promise_test(async t => {
+    await registerConstantLocalTimeAnimator(1000);
+    const target = document.getElementById("target");
+    const effect = new KeyframeEffect(
+        target,
+        [
+          { background: 'green' },
+          { background: 'blue' },
+        ],
+        { duration: 2000 }
+    );
+
+    const target2 = document.getElementById("target2");
+    const effect2 = new KeyframeEffect(
+        target2,
+        [
+          { boxShadow: '4px 4px 25px blue' },
+          { boxShadow: '4px 4px 25px green' }
+        ],
+        { duration: 2000 }
+    );
+    const animation = new WorkletAnimation('constant_time', effect);
+    animation.play();
+    const animation2 = new WorkletAnimation('constant_time', effect2);
+    animation2.play();
+
+    await waitForAsyncAnimationFrames(1);
+    assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 64, 128)");
+    assert_equals(getComputedStyle(target2).boxShadow, "rgb(0, 64, 128) 4px 4px 25px 0px");
+  }, "Individual worklet animation should output values at specified local time for corresponding targets and effects");
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/animation-worklet/cancel-non-accelerated-property.https.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Cancel non accelerated property using worklet animation</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-animationworklet/">
+
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/web-animations/testcommon.js"></script>
+<script src="common.js"></script>
+
+<style>
+#target {
+  background-color: red;
+}
+</style>
+
+<div id="target"></div>
+
+<script>
+  promise_test(async t => {
+    await registerConstantLocalTimeAnimator(1000);
+    const target = document.getElementById('target');
+    const effect = new KeyframeEffect(
+        target,
+        [
+          { background: 'green' },
+          { background: 'blue' },
+        ],
+        {
+          duration: 2000,
+          iteration: Infinity
+        }
+    );
+    const animation = new WorkletAnimation('constant_time', effect);
+    animation.play();
+
+    await waitForAsyncAnimationFrames(1);
+    // establish that the animation started
+    assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 64, 128)");
+    animation.cancel();
+
+    await waitForAsyncAnimationFrames(1);
+    // confirm the animation is cancelled
+    assert_equals(getComputedStyle(target).backgroundColor, "rgb(255, 0, 0)");
+  }, "Animation should update the outputs after starting and then return to pre-animated values after being cancelled");
+</script>
\ No newline at end of file