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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-visibility.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset=utf-8>
3 <title>Effect value computation tests for 'visibility' property</title>
4 <link rel="help" href="https://w3c.github.io/web-animations/#the-effect-value-of -a-keyframe-animation-effect">
5 <script src="/resources/testharness.js"></script>
6 <script src="/resources/testharnessreport.js"></script>
7 <script src="../../testcommon.js"></script>
8 <body>
9 <div id="log"></div>
10 <div id="target"></div>
11 <script>
12 'use strict';
13
14 test(function(t) {
15 var div = createDiv(t);
16 var anim = div.animate({ visibility: ['hidden','visible'] },
17 { duration: 100 * MS_PER_SEC, fill: 'both' });
18
19 anim.currentTime = 0;
20 assert_equals(getComputedStyle(div).visibility, 'hidden',
21 'Visibility when progress = 0');
22
23 anim.currentTime = 10 * MS_PER_SEC + 1;
24 assert_equals(getComputedStyle(div).visibility, 'visible',
25 'Visibility when progress > 0 due to linear easing');
26
27 anim.finish();
28 assert_equals(getComputedStyle(div).visibility, 'visible',
29 'Visibility when progress = 1');
30
31 }, 'Visibility clamping behavior');
32
33 test(function(t) {
34 var div = createDiv(t);
35 var anim = div.animate({ visibility: ['hidden', 'visible'] },
36 { duration: 100 * MS_PER_SEC, fill: 'both',
37 easing: 'cubic-bezier(0.25, -0.6, 0, 0.5)' });
38
39 anim.currentTime = 0;
40 assert_equals(getComputedStyle(div).visibility, 'hidden',
41 'Visibility when progress = 0');
42
43 // Timing function is below zero. So we expected visibility is hidden.
44 anim.currentTime = 10 * MS_PER_SEC + 1;
45 assert_equals(getComputedStyle(div).visibility, 'hidden',
46 'Visibility when progress < 0 due to cubic-bezier easing');
47
48 anim.currentTime = 60 * MS_PER_SEC;
49 assert_equals(getComputedStyle(div).visibility, 'visible',
50 'Visibility when progress > 0 due to cubic-bezier easing');
51
52 }, 'Visibility clamping behavior with an easing that has a negative component');
53
54 </script>
55 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698