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

Side by Side Diff: LayoutTests/web-animations-api/w3c/getAnimationPlayers.html

Issue 423763002: Animations: Fix bug where getAnimationPlayers() crashes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/animation/ElementAnimation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <style> 4 <style>
5 @keyframes test { 5 @keyframes test {
6 from { opacity: 0; } 6 from { opacity: 0; }
7 to { opacity: 1; } 7 to { opacity: 1; }
8 } 8 }
9 .cssAnimation { 9 .cssAnimation {
10 animation: test 2s; 10 animation: test 2s;
11 } 11 }
12 </style> 12 </style>
13 <div id='container'> 13 <div id='container'>
14 <div id='element'></div> 14 <div id='element'></div>
15 </div> 15 </div>
16 16
17 <script> 17 <script>
18 18
19 var container = document.getElementById('container'); 19 var container = document.getElementById('container');
20 var element = document.getElementById('element'); 20 var element = document.getElementById('element');
21 21
22 test(function() { 22 test(function() {
23 assert_equals(document.timeline.getAnimationPlayers().length, 0); 23 assert_equals(document.timeline.getAnimationPlayers().length, 0);
24 assert_equals(container.getAnimationPlayers().length, 0);
25 assert_equals(element.getAnimationPlayers().length, 0);
24 26
25 var player = element.animate([], 1000); 27 var player = element.animate([], 1000);
26 assert_equals(document.timeline.getAnimationPlayers().length, 1); 28 assert_equals(document.timeline.getAnimationPlayers().length, 1);
27 assert_equals(document.timeline.getAnimationPlayers()[0], player); 29 assert_equals(document.timeline.getAnimationPlayers()[0], player);
28 30
29 var player2 = container.animate([], 1000); 31 var player2 = container.animate([], 1000);
30 assert_equals(document.timeline.getAnimationPlayers().length, 2); 32 assert_equals(document.timeline.getAnimationPlayers().length, 2);
31 assert_equals(document.timeline.getAnimationPlayers()[0], player); 33 assert_equals(document.timeline.getAnimationPlayers()[0], player);
32 assert_equals(document.timeline.getAnimationPlayers()[1], player2); 34 assert_equals(document.timeline.getAnimationPlayers()[1], player2);
33 35
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 players[0].finish(); 111 players[0].finish();
110 assert_equals(document.timeline.getAnimationPlayers().length, 0); 112 assert_equals(document.timeline.getAnimationPlayers().length, 0);
111 assert_equals(container.getAnimationPlayers().length, 0); 113 assert_equals(container.getAnimationPlayers().length, 0);
112 assert_equals(element.getAnimationPlayers().length, 0); 114 assert_equals(element.getAnimationPlayers().length, 0);
113 t.done(); 115 t.done();
114 } 116 }
115 }); 117 });
116 }, 'getAnimationPlayers() with cssanimations'); 118 }, 'getAnimationPlayers() with cssanimations');
117 119
118 </script> 120 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/animation/ElementAnimation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698