gecko-dev/testing/web-platform/tests/animation-worklet/worklet-animation-with-invalid-effect.https.html
Majid Valipour a592b99718 Bug 1523562 [wpt PR 14848] - [animation-worklet] clean up wpt tests, a=testonly
Automatic update from web-platform-tests
[animation-worklet] clean up wpt tests

- Fix a test that should have been an async test but was not.
- Use existing web-animation common utils where applicable.
- Introduce and use common worklets (passthrough, constant_time) for testing.

Bug: 915352
Change-Id: I5f503bebe3bc4be4f3c76a84604df63a905439e2
Reviewed-on: https://chromium-review.googlesource.com/c/1409807
Reviewed-by: Yi Gu <yigu@chromium.org>
Commit-Queue: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623880}

--

wpt-commits: 10e848f92af92631533edad9d3931924722c9e78
wpt-pr: 14848
2019-02-07 21:50:36 +00:00

36 lines
967 B
HTML

<!DOCTYPE html>
<title>Test that worklet animation with invalid effect cannot be played</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 {
width: 100px;
height: 100px;
}
</style>
<div id="target"></div>
<script>
'use strict';
promise_test(async function() {
await registerPassthroughAnimator();
let playFunc = function() {
let effect = new KeyframeEffect(
document.getElementById('target'),
[
// No keyframe.
],
{ duration: 1000 }
);
let animation = new WorkletAnimation('passthrough', effect);
animation.play();
}
assert_throws('InvalidStateError', playFunc);
}, 'Trying to play invalid worklet animation should throw an exception.');
</script>