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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/web-animations/animation-effect-timing/iterations.html

Issue 1899623002: Import latest web-platform-tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: handle new failures Created 4 years, 8 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>iterations tests</title>
4 <link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffect timing-iterations">
5 <script src="../../../../resources/testharness.js"></script>
6 <script src="../../../../resources/testharnessreport.js"></script>
7 <script src="../testcommon.js"></script>
8 <link rel="stylesheet" href="../../../../resources/testharness.css">
9 <body>
10 <div id="log"></div>
11 <script>
12 'use strict';
13
14 test(function(t) {
15 var div = createDiv(t);
16 var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
17 anim.effect.timing.iterations = 2;
18 assert_equals(anim.effect.timing.iterations, 2, 'set duration 2');
19 assert_equals(anim.effect.getComputedTiming().iterations, 2,
20 'getComputedTiming() after set iterations 2');
21 }, 'set iterations 2');
22
23 test(function(t) {
24 var div = createDiv(t);
25 var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
26 anim.effect.timing.iterations = Infinity;
27 assert_equals(anim.effect.timing.iterations, Infinity, 'set duration Infinity' );
28 assert_equals(anim.effect.getComputedTiming().iterations, Infinity,
29 'getComputedTiming() after set iterations Infinity');
30 }, 'set iterations Infinity');
31
32 test(function(t) {
33 var div = createDiv(t);
34 var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
35 assert_throws({ name: 'TypeError' }, function() {
36 anim.effect.timing.iterations = -1;
37 });
38 }, 'set negative iterations');
39
40 test(function(t) {
41 var div = createDiv(t);
42 var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
43 assert_throws({ name: 'TypeError' }, function() {
44 anim.effect.timing.iterations = -Infinity;
45 });
46 }, 'set negative infinity iterations ');
47
48 test(function(t) {
49 var div = createDiv(t);
50 var anim = div.animate({ opacity: [ 0, 1 ] }, 2000);
51 assert_throws({ name: 'TypeError' }, function() {
52 anim.effect.timing.iterations = NaN;
53 });
54 }, 'set NaN iterations');
55
56 </script>
57 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698