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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay.html

Issue 2610243002: Import wpt@5e1a3b80cea8d36774d2afd78b29a74792e9f15a (Closed)
Patch Set: Rebased Created 3 years, 11 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <meta charset=utf-8> 2 <meta charset=utf-8>
3 <title>endDelay tests</title> 3 <title>endDelay tests</title>
4 <link rel="help" href="http://w3c.github.io/web-animations/#dom-animationeffectt iming-enddelay"> 4 <link rel="help" href="http://w3c.github.io/web-animations/#dom-animationeffectt iming-enddelay">
5 <link rel="author" title="Ryo Motozawa" href="mailto:motozawa@mozilla-japan.org" > 5 <link rel="author" title="Ryo Motozawa" href="mailto:motozawa@mozilla-japan.org" >
6 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharness.js"></script>
7 <script src="/resources/testharnessreport.js"></script> 7 <script src="/resources/testharnessreport.js"></script>
8 <script src="../../testcommon.js"></script> 8 <script src="../../testcommon.js"></script>
9 <body> 9 <body>
10 <div id="log"></div> 10 <div id="log"></div>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return waitForAnimationFrames(2); 59 return waitForAnimationFrames(2);
60 }).then(t.step_func(function() { 60 }).then(t.step_func(function() {
61 t.done(); 61 t.done();
62 })); 62 }));
63 }, 'onfinish event is not fired duration endDelay'); 63 }, 'onfinish event is not fired duration endDelay');
64 64
65 async_test(function(t) { 65 async_test(function(t) {
66 var div = createDiv(t); 66 var div = createDiv(t);
67 var anim = div.animate({ opacity: [ 0, 1 ] }, 67 var anim = div.animate({ opacity: [ 0, 1 ] },
68 { duration: 100000, endDelay: 30000 }); 68 { duration: 100000, endDelay: 30000 });
69 var finishedTimelineTime;
70 anim.finished.then(function() {
71 finishedTimelineTime = anim.timeline.currentTime;
72 });
73
74 var receivedEvents = [];
75 anim.onfinish = function(event) {
76 receivedEvents.push(event);
77 }
78
79 anim.ready.then(function() { 69 anim.ready.then(function() {
80 anim.currentTime = 110000; // during endDelay 70 anim.currentTime = 110000; // during endDelay
71 anim.onfinish = t.step_func(function(event) {
72 assert_unreached('onfinish event should not be fired during endDelay');
73 });
81 return waitForAnimationFrames(2); 74 return waitForAnimationFrames(2);
82 }).then(t.step_func(function() { 75 }).then(t.step_func(function() {
83 assert_equals(receivedEvents.length, 0, 76 anim.onfinish = t.step_func(function(event) {
84 'onfinish event is should not be fired' + 77 t.done();
85 'when currentTime is during endDelay'); 78 });
86 anim.currentTime = 130000; // after endTime 79 anim.currentTime = 130000; // after endTime
87 return waitForAnimationFrames(2);
88 })).then(t.step_func_done(function() {
89 assert_equals(receivedEvents.length, 1, 'length of array should be one');
90 assert_equals(receivedEvents[0].timelineTime, finishedTimelineTime,
91 'receivedEvents[0].timelineTime should equal to the animation timeline '
92 + 'when finished promise is resolved');
93 })); 80 }));
94 }, 'onfinish event is fired currentTime is after endTime'); 81 }, 'onfinish event is fired currentTime is after endTime');
95 82
96 </script> 83 </script>
97 </body> 84 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698