5 Test for animation.effect.updateTiming({ duration }) on compositor
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script src=
"/tests/SimpleTest/paint_listener.js"></script>
10 <script type=
"application/javascript" src=
"animation_utils.js"></script>
11 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css">
12 <style type=
"text/css">
14 0% { transform: translate
(0px) }
15 100% { transform: translate
(100px) }
18 /* The animation target needs geometry in order to qualify for OMTA */
21 background-color: white
;
26 <div id=
"display"></div>
27 <script type=
"application/javascript">
30 SimpleTest.waitForExplicitFinish();
32 runOMTATest(function() {
33 runAllAsyncAnimTests().then(SimpleTest.finish);
34 }, SimpleTest.finish, SpecialPowers);
36 addAsyncAnimTest(async function() {
37 var [ div ] = new_div(
"");
38 var animation = div.animate(
39 [ { transform: 'translate(
0px)', easing:
"steps(2, start)" },
40 { transform: 'translate(
100px)' } ],
4000);
41 await waitForPaints();
44 omta_is(div,
"transform", { tx:
50 }, RunningOn.Compositor,
45 "Animation is running on compositor");
46 animation.effect.updateTiming({ duration:
2000 });
47 // Setter of timing option should set up the changes to animations for the
48 // next layer transaction but it won't schedule a paint immediately so we need
49 // to tick the refresh driver before we can wait on the next paint.
52 await waitForPaints();
53 omta_is(div,
"transform", { tx:
50 }, RunningOn.Compositor,
54 "Animation remains on compositor");
57 omta_is(div,
"transform", { tx:
100 }, RunningOn.Compositor,
58 "Animation is updated on compositor");
63 addAsyncAnimTest(async function() {
64 var [ div ] = new_div(
"");
65 var animation = div.animate(
66 [ { transform: 'translate(
0px)', easing:
"steps(2, end)" },
67 { transform: 'translate(
100px)' } ],
4000);
68 await waitForPaints();
71 animation.effect.updateTiming({ duration:
2000 });
73 await waitForPaints();
74 omta_is(div,
"transform", { tx:
50 }, RunningOn.Compositor,
75 "Animation is running on compositor");