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

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

Issue 2910883002: Clean up duplicate tests in web-animations-api (Closed)
Patch Set: Rebase and remove one more reference to deleted test Created 3 years, 6 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>Canceling an animation: cancel event</title>
4 <link rel="help" href="https://w3c.github.io/web-animations/#canceling-an-animat ion-section">
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <body>
8 <script>
9 var anim1 = document.body.animate([], 100000);
10 var anim2 = document.body.animate([], 100000);
11
12 var cancelTest = async_test('Cancelling animation should fire a cancel event.');
13 var fired = false;
14
15 anim1.oncancel = function(event) {
16 cancelTest.step(function() {
17 assert_equals(event.target, anim1, 'Target of cancel event should be anim1.' );
18 assert_equals(event.currentTime, null, 'currentTime of cancel event should b e null.');
19 assert_equals(event.timelineTime, document.timeline.currentTime, 'Event time lineTime should be same as document.timeline.currentTime.');
20 });
21 fired = true;
22 };
23
24 anim2.onfinish = function() {
25 cancelTest.step(function() {
26 assert_true(fired, 'anim1.oncancel should be called.');
27 });
28 cancelTest.done();
29 };
30
31 anim1.cancel();
32 anim2.finish();
33 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698