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

Side by Side Diff: third_party/WebKit/LayoutTests/web-animations-api/player-cancel-event.html

Issue 2137333002: Prepare animation-cancel-event.html for upstreaming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <body>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script>
6 var anim1 = document.body.animate([], 100000);
7 var anim2 = document.body.animate([], 100000);
8
9 var cancelTest = async_test('Cancelling animation should create cancel event.');
10 var fired = false;
11
12 anim1.oncancel = function(event) {
13 cancelTest.step(function() {
14 assert_equals(event.target, anim1, 'Target of cancel event should be anim1.' );
15 assert_equals(event.currentTime, null, 'currentTime of cancel event should b e null.');
16 assert_equals(event.timelineTime, document.timeline.currentTime, 'Event time lineTime should be same as document.timeline.currentTime.');
17 });
18 fired = true;
19 };
20
21 anim2.onfinish = function() {
22 cancelTest.step(function() {
23 assert_true(fired, 'anim1.oncancel should be called.');
24 });
25 cancelTest.done();
26 };
27
28 anim1.cancel();
29 anim2.finish();
30 </script>
31 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698