Bug 1466031 - Update test_setting-effect.html; r?hiro
Apart from whitespace / test description tests this patch also drops an
assertion about the animation playState since it seems unrelated to the purpose
of that particular test.
MozReview-Commit-ID: 4Z2fjsGl1Di
--- a/dom/animation/test/css-animations/test_setting-effect.html
+++ b/dom/animation/test/css-animations/test_setting-effect.html
@@ -1,23 +1,23 @@
<!doctype html>
<meta charset=utf-8>
<title>CSSAnimation.effect</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src='../testcommon.js'></script>
<style>
- @keyframes anim {
- from {
- margin-left: 0px;
- }
- to {
- margin-left: 100px;
- }
+@keyframes anim {
+ from {
+ margin-left: 0px;
}
+ to {
+ margin-left: 100px;
+ }
+}
</style>
<body>
<div id="log"></div>
<script>
'use strict';
promise_test(async t => {
const div = addDiv(t);
@@ -41,17 +41,16 @@ promise_test(async t => {
const animation = div.getAnimations()[0];
await animation.ready;
animation.currentTime = 50 * MS_PER_SEC;
animation.effect = new KeyframeEffect(div,
{ left: [ '0px' , '100px'] },
100 * MS_PER_SEC);
- assert_equals(animation.playState, 'running');
assert_equals(getComputedStyle(div).marginLeft, '0px');
assert_equals(getComputedStyle(div).left, '50px');
}, 'Replacing an animation\'s effect with an effect that targets a different ' +
'property should update both properties');
promise_test(async t => {
const div = addDiv(t);
div.style.animation = 'anim 100s';
@@ -101,18 +100,18 @@ promise_test(async t => {
100 * MS_PER_SEC);
await watcher1.wait_for('animationstart');
assert_equals(animation.effect.target, div2);
// Then wait a couple of frames and check that no event was dispatched.
await waitForAnimationFrames(2);
-}, 'The event is dispatched at the original element even after setting an ' +
- 'effect with a different target element');
+}, 'CSS animation events are dispatched at the original element even after'
+ + ' setting an effect with a different target element');
promise_test(async t => {
const div = addDiv(t);
const watcher = new EventWatcher(t, div, [ 'animationstart',
'animationend',
'animationcancel' ]);
div.style.animation = 'anim 100s';
const animation = div.getAnimations()[0];