Bug 1518403 - Add test that animations with a negative playback rate are sent to the compositor even in the delay phase; r=hiro
authorBrian Birtles <birtles@gmail.com>
Thu, 10 Jan 2019 00:40:27 +0000
changeset 510291 2f2b4d6aabeb00640e80a22309387c8390988b47
parent 510290 052892f1cbd1c519bbcb278e54e1207f258430fb
child 510292 1f487879b4d7fd68d64edc3fb211d0fbfdb97987
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershiro
bugs1518403
milestone66.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 1518403 - Add test that animations with a negative playback rate are sent to the compositor even in the delay phase; r=hiro Depends on D16131 Differential Revision: https://phabricator.services.mozilla.com/D16132
dom/animation/test/chrome/test_running_on_compositor.html
--- a/dom/animation/test/chrome/test_running_on_compositor.html
+++ b/dom/animation/test/chrome/test_running_on_compositor.html
@@ -477,17 +477,30 @@ promise_test(async t => {
 
   animation.currentTime = 100 * MS_PER_SEC;
   await waitForFrame();
 
   assert_animation_is_running_on_compositor(animation,
       'Animation with fill:backwards in delay phase reports ' +
       'that it is running on the compositor after delay phase');
 }, 'animation with fill:backwards in delay phase is running on the ' +
-   ' main-thread while it is in delay phase');
+   ' compositor while it is in delay phase');
+
+promise_test(async t => {
+  const animation = addDiv(t).animate({ opacity: [ 0, 1 ] }, 100 * MS_PER_SEC);
+  animation.playbackRate = -1;
+  animation.currentTime = 200 * MS_PER_SEC;
+
+  await waitForPaints();
+
+  assert_animation_is_running_on_compositor(animation,
+                'Animation with negative playback rate is runnning on the'
+                + ' compositor even before it reaches the active interval');
+}, 'animation with negative playback rate is sent to the compositor even in'
+   + ' after phase');
 
 promise_test(async t => {
   var div = addDiv(t);
   var animation = div.animate([{ opacity: 1, offset: 0 },
                                { opacity: 1, offset: 0.99 },
                                { opacity: 0, offset: 1 }], 100 * MS_PER_SEC);
 
   var another = addDiv(t);
@@ -1001,30 +1014,30 @@ promise_test(async t => {
   if (!isWebRender) {
     assert_animation_is_running_on_compositor(animation,
       'background-color animation should be running on the compositor');
   } else {
     assert_animation_is_not_running_on_compositor(animation,
       'background-color animation is not yet able to run on the compositor ' +
       'on WebRender');
   }
-}, 'backgound-color animation runs on the compositor');
+}, 'background-color animation runs on the compositor');
 
 promise_test(async t => {
   await SpecialPowers.pushPrefEnv({
     set: [["gfx.omta.background-color", false]]
   });
 
   const div = addDiv(t);
   const animation = div.animate({ backgroundColor: ['blue', 'green'] },
                                 100 * MS_PER_SEC);
 
   await waitForAnimationReadyToRestyle(animation);
   await waitForPaints();
 
   assert_animation_is_not_running_on_compositor(animation,
     'background-color animation should NOT be running on the compositor ' +
     'if the pref is disabled');
-}, 'backgound-color animation does not run on the compositor if the pref ' +
+}, 'background-color animation does not run on the compositor if the pref ' +
    'is disabled');
 
 </script>
 </body>