Bug 1195180 part 9 - Add test for seeking finished -> paused; r=heycam
authorBrian Birtles <birtles@gmail.com>
Mon, 28 Sep 2015 12:38:41 +0900
changeset 264673 3aa2e3b0f240e50c5fb3bbcc941a3bb6a595b24d
parent 264672 05dfb6716db36f5f6045264d243eb24c595288c1
child 264674 19e81f18c957819b098b6a47781c5df929e427b3
push id29444
push usercbook@mozilla.com
push dateMon, 28 Sep 2015 12:17:21 +0000
treeherdermozilla-central@031db40e2b55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1195180
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1195180 part 9 - Add test for seeking finished -> paused; r=heycam This patch adds a test that even when we seek from being irrelevant to another state where we no longer need ticks that we still spin the refresh driver in order to queue and dispatch an animationstart event.
dom/animation/test/css-animations/file_animation-currenttime.html
--- a/dom/animation/test/css-animations/file_animation-currenttime.html
+++ b/dom/animation/test/css-animations/file_animation-currenttime.html
@@ -436,16 +436,34 @@ async_test(function(t) {
     waitForAnimationFrames(2).then(function() {
       t.done();
     });
   });
   // get us into the initial state:
   animation.currentTime = currentTimeForAfterPhase(animation.timeline);
 }, 'Redundant change, after -> active, then back');
 
+async_test(function(t) {
+  var div = addDiv(t, {'class': 'animated-div'});
+  var eventWatcher = new EventWatcher(t, div, CSS_ANIM_EVENTS);
+  div.style.animation = ANIM_PROPERTY_VAL;
+  var animation = div.getAnimations()[0];
+
+  animation.pause();
+  animation.currentTime = currentTimeForAfterPhase(animation.timeline);
+
+  eventWatcher.wait_for(['animationstart',
+                         'animationend']).then(t.step_func(function() {
+    animation.currentTime = currentTimeForActivePhase(animation.timeline);
+    return eventWatcher.wait_for('animationstart');
+  })).then(t.step_func(function() {
+    t.done();
+  }));
+
+}, 'Seeking finished -> paused dispatches animationstart');
 
 async_test(function(t) {
   var div = addDiv(t, {'class': 'animated-div'});
   div.style.animation = ANIM_PROPERTY_VAL;
 
   var animation = div.getAnimations()[0];
 
   animation.ready.then(t.step_func(function() {