Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: third_party/WebKit/LayoutTests/web-animations-api/delay-endDelay-phases.html

Issue 2139113002: Add the relevant information to the test and use testcommon.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to Alan's comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <script src="../imported/wpt/web-animations/testcommon.js"></script>
8 <body></body>
5 <script> 9 <script>
6 function testTiming({timing, expectations}, description) { 10 function testTiming({timing, expectations}, description) {
7 test(() => { 11 test(t => {
8 for (let {at, expect} of expectations) { 12 for (let {at, expect} of expectations) {
9 let target = document.createElement('div'); 13 let target = createDiv(t);
10 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_times_equal(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({
20 timing: { 23 timing: {
21 duration: 10, 24 duration: 10,
22 delay: 1, 25 delay: 1,
23 endDelay: 1, 26 endDelay: 1,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
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>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698