| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset=utf-8> | 2 <meta charset=utf-8> |
| 3 <title>Garbage collect an animation with a finish promise</title> | 3 <title>Garbage collect an animation with a finish promise</title> |
| 4 <script src="../resources/testharness.js"></script> | 4 <script src="../resources/testharness.js"></script> |
| 5 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
| 6 <script src="../resources/gc.js"></script> |
| 6 <body> | 7 <body> |
| 7 <script> | 8 <script> |
| 8 function gc() | |
| 9 { | |
| 10 return GCController.collectAll(); | |
| 11 } | |
| 12 | |
| 13 async_test(t => { | 9 async_test(t => { |
| 14 assert_exists(window, "GCController", "gc controller needed"); | 10 assert_exists(window, "GCController", "gc controller needed"); |
| 15 setInterval(gc, 0); | 11 setInterval(gc, 0); |
| 16 | 12 |
| 17 var anim = document.body.animate(null, 1); | 13 var anim = document.body.animate(null, 1); |
| 18 var promise = anim.finished; | 14 var promise = anim.finished; |
| 19 | 15 |
| 20 promise.then(() => { | 16 promise.then(() => { |
| 21 t.done(); | 17 t.done(); |
| 22 }); | 18 }); |
| 23 }, 'Animation finish promise resolved if animation is garbage collected'); | 19 }, 'Animation finish promise resolved if animation is garbage collected'); |
| 24 </script> | 20 </script> |
| 25 </body> | 21 </body> |
| OLD | NEW |