OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <div id="target">Test.</div> | 2 <div id="target">Test.</div> |
3 <script> | 3 <script> |
4 if (window.testRunner) | 4 if (window.testRunner) |
5 testRunner.waitUntilDone(); | 5 testRunner.waitUntilDone(); |
6 | 6 |
7 function waitForCompositor() { | 7 function waitForCompositor() { |
8 return document.body.animate({opacity: [1, 1]}, 1).finished; | 8 return document.body.animate({opacity: [1, 1]}, 1).finished; |
9 } | 9 } |
10 | 10 |
11 target.animate({translate: '100px'}, 1e8); | 11 target.animate({translate: '100px'}, 1e8); |
12 | 12 |
13 requestAnimationFrame(() => { | 13 requestAnimationFrame(() => { |
14 requestAnimationFrame(() => { | 14 requestAnimationFrame(() => { |
15 target.style.translate = '100px'; | 15 target.style.translate = '100px'; |
16 requestAnimationFrame(() => { | 16 requestAnimationFrame(() => { |
17 waitForCompositor().then(() => { | 17 waitForCompositor().then(() => { |
18 if (window.testRunner) | 18 if (window.testRunner) |
19 testRunner.notifyDone(); | 19 testRunner.notifyDone(); |
20 }); | 20 }); |
21 }); | 21 }); |
22 }); | 22 }); |
23 }); | 23 }); |
24 </script> | 24 </script> |
OLD | NEW |