Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <meta charset=utf-8> | |
| 3 <title>Test combinations of delay and endDelay</title> | |
| 4 <link rel="help" href="https://w3c.github.io/web-animations/#the-animationeffect timing-interface"> | |
| 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="container"></div> | 7 <div id="container"></div> |
| 5 <script> | 8 <script> |
| 6 function testTiming({timing, expectations}, description) { | 9 function testTiming({timing, expectations}, description) { |
| 7 test(() => { | 10 test(() => { |
| 8 for (let {at, expect} of expectations) { | 11 for (let {at, expect} of expectations) { |
| 9 let target = document.createElement('div'); | 12 let target = document.createElement('div'); |
|
alancutter (OOO until 2018)
2016/07/12 00:56:43
We should probably be using https://cs.chromium.or
nainar
2016/07/12 01:21:22
Done.
| |
| 10 container.appendChild(target); | 13 container.appendChild(target); |
| 11 let animation = target.animate({opacity: [0, 1]}, timing); | 14 let animation = target.animate({opacity: [0, 1]}, timing); |
| 12 animation.currentTime = at; | 15 animation.currentTime = at; |
| 13 assert_equals(Number(getComputedStyle(target).opacity), expect, 'at ' + at ); | 16 assert_equals(Number(getComputedStyle(target).opacity), expect, 'at ' + at ); |
| 14 animation.cancel(); | 17 animation.cancel(); |
| 15 } | 18 } |
| 16 }, description); | 19 }, description); |
| 17 } | 20 } |
| 18 | 21 |
| 19 testTiming({ | 22 testTiming({ |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 { at: -2, expect: 0 }, | 101 { at: -2, expect: 0 }, |
| 99 { at: -1, expect: 1 }, | 102 { at: -1, expect: 1 }, |
| 100 { at: 0, expect: 1 }, | 103 { at: 0, expect: 1 }, |
| 101 { at: 5, expect: 1 }, | 104 { at: 5, expect: 1 }, |
| 102 { at: 10, expect: 1 }, | 105 { at: 10, expect: 1 }, |
| 103 { at: 11, expect: 1 }, | 106 { at: 11, expect: 1 }, |
| 104 { at: 12, expect: 1 }, | 107 { at: 12, expect: 1 }, |
| 105 ], | 108 ], |
| 106 }, 'Negative endDelay that eclipses delay and duration'); | 109 }, 'Negative endDelay that eclipses delay and duration'); |
| 107 </script> | 110 </script> |
| OLD | NEW |