2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
11 <div id=target1
></div>
12 <div id=target2
></div>
15 anim1
= target1
.animate([
17 {transform
: 'translateX(500px)'},
20 function awaitFrame(frameTest
) {
21 return new Promise(resolve
=> {
22 requestAnimationFrame(() => {
26 awaitFrame(frameTest
).then(resolve
);
32 awaitFrame(() => anim1
.currentTime
> 100).then(() => {
33 requestAnimationFrame(t
=> {
34 // Testing a regression where scheduling anim1 and anim2 together caused anim2
35 // to get anim1's start time.
36 anim1
.startTime
= t
- 100;
37 anim2
= target2
.animate([
39 {transform
: 'translateX(500px)'},
45 awaitFrame(() => anim2
&& anim2
.startTime
!= null).then(() => {
46 t
.step(() => assert_not_equals(Math
.round(anim1
.startTime
), Math
.round(anim2
.startTime
)));