Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset=utf-8> | |
| 3 <title>Deferred Updates Test</title> | |
| 4 <link rel="help" href="http://w3c.github.io/web-animations/#model-liveness"> | |
| 2 <script src="../resources/testharness.js"></script> | 5 <script src="../resources/testharness.js"></script> |
| 3 <script src="../resources/testharnessreport.js"></script> | 6 <script src="../resources/testharnessreport.js"></script> |
| 4 <div id="target">Test target</div> | 7 <script src="../../../testcommon.js"></script> |
|
alancutter (OOO until 2018)
2016/07/12 00:51:58
Does this exist? I think you want to be importing
| |
| 8 <body> | |
| 9 <div id="target"></div> | |
| 5 <script> | 10 <script> |
| 11 'use strict'; | |
| 6 var target = document.getElementById('target'); | 12 var target = document.getElementById('target'); |
| 7 test(function() { | 13 test(function() { |
| 8 var player = target.animate([{background: 'green'}, {background: 'green'}], 10 000); | 14 var animation = target.animate([{background: 'green'}, {background: 'green'}], 10000); |
| 9 assert_equals(getComputedStyle(target).backgroundColor, 'rgb(0, 128, 0)'); | 15 assert_equals(getComputedStyle(target).backgroundColor, 'rgb(0, 128, 0)'); |
| 10 player.cancel(); | 16 animation.cancel(); |
| 11 }, 'Animation effects should be visible to getComputedStyle'); | 17 }, 'Animation effects should be visible to getComputedStyle'); |
| 12 | 18 |
| 13 var layoutTest = async_test('Animation effects should be visible to offsetHeight , etc.'); | 19 var t = async_test('Animation effects should be visible to offsetHeight, etc.'); |
| 14 addEventListener('load', function() { | 20 addEventListener('load', function() { |
|
alancutter (OOO until 2018)
2016/07/12 00:51:58
I don't think waiting for load is necessary for th
| |
| 15 layoutTest.step(function() { | 21 t.step(function() { |
| 16 var player = target.animate([{height: '732px'}, {height: '732px'}], 10000); | 22 var animation = target.animate([{height: '732px'}, {height: '732px'}], 10000 ); |
| 17 assert_equals(target.offsetHeight, 732); | 23 assert_equals(target.offsetHeight, 732); |
| 18 player.cancel(); | 24 animation.cancel(); |
| 19 }); | 25 }); |
| 20 layoutTest.done(); | 26 t.done(); |
| 21 target.remove(); | 27 target.remove(); |
| 22 }); | 28 }); |
| 23 </script> | 29 </script> |
| 30 </body> | |
| OLD | NEW |