From cff6e480f0d8b4d567934a134f96247bdd4a4405 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Mon, 4 Nov 2019 14:55:24 +0000 Subject: [PATCH] Bug 1587713 - Adjust the tests to account for transform layerization changes with webrender. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D50963 --HG-- extra : moz-landing-system : lando --- .../test_animation_performance_warning.html | 56 ++++++++----------- dom/animation/test/mozilla/file_restyles.html | 14 ++--- 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/dom/animation/test/chrome/test_animation_performance_warning.html b/dom/animation/test/chrome/test_animation_performance_warning.html index fbd526c32dd0..55fe50ced6c4 100644 --- a/dom/animation/test/chrome/test_animation_performance_warning.html +++ b/dom/animation/test/chrome/test_animation_performance_warning.html @@ -1470,32 +1470,27 @@ function testTooLargeFrame() { await waitForFrame(); // viewport depends on test environment. - const isWebRender = - SpecialPowers.DOMWindowUtils.layerManagerType == 'WebRender'; var expectedWarning = new RegExp( "Animation cannot be run on the compositor because the area of the frame " + "\\(\\d+\\) is too large relative to the viewport " + "\\(larger than \\d+\\)"); - if (isWebRender) { - // With WebRender, the large size frame could run on compositor. - assert_animation_property_state_equals( - animation.effect.getProperties(), - [ { property: subtest.property, runningOnCompositor: true } ]); - } else { - assert_animation_property_state_equals( - animation.effect.getProperties(), - [ { - property: subtest.property, - runningOnCompositor: false, - warning: expectedWarning - } ]); - } + assert_animation_property_state_equals( + animation.effect.getProperties(), + [ { + property: subtest.property, + runningOnCompositor: false, + warning: expectedWarning + } ]); animation.effect.target.style = 'width: 100px; height: 100px'; await waitForFrame(); + // With WebRender we appear to stick to the previous layerization decision + // after changing the bounds back to a smaller object. + const isWebRender = + SpecialPowers.DOMWindowUtils.layerManagerType == 'WebRender'; assert_animation_property_state_equals( animation.effect.getProperties(), - [ { property: subtest.property, runningOnCompositor: true } ]); + [ { property: subtest.property, runningOnCompositor: !isWebRender } ]); }, subtest.property + ' on too big element - area'); promise_test(async t => { @@ -1512,33 +1507,26 @@ function testTooLargeFrame() { await waitForFrame(); // viewport depends on test environment. - const isWebRender = - SpecialPowers.DOMWindowUtils.layerManagerType == 'WebRender'; var expectedWarning = new RegExp( "Animation cannot be run on the compositor because the frame size " + "\\(20000, 1\\) is too large relative to the viewport " + "\\(larger than \\(\\d+, \\d+\\)\\) or larger than the " + "maximum allowed value \\(\\d+, \\d+\\)"); - if (isWebRender) { - // With WebRender, the large size frame could run on compositor. - assert_animation_property_state_equals( - animation.effect.getProperties(), - [ { property: subtest.property, runningOnCompositor: true } ]); - } else { - assert_animation_property_state_equals( - animation.effect.getProperties(), - [ { - property: subtest.property, - runningOnCompositor: false, - warning: expectedWarning - } ]); - } + assert_animation_property_state_equals( + animation.effect.getProperties(), + [ { + property: subtest.property, + runningOnCompositor: false, + warning: expectedWarning + } ]); animation.effect.target.style = 'width: 100px; height: 100px'; await waitForFrame(); + const isWebRender = + SpecialPowers.DOMWindowUtils.layerManagerType == 'WebRender'; assert_animation_property_state_equals( animation.effect.getProperties(), - [ { property: subtest.property, runningOnCompositor: true } ]); + [ { property: subtest.property, runningOnCompositor: !isWebRender } ]); }, subtest.property + ' on too big element - dimensions'); }); } diff --git a/dom/animation/test/mozilla/file_restyles.html b/dom/animation/test/mozilla/file_restyles.html index f7dcf14c5142..5991b725f00d 100644 --- a/dom/animation/test/mozilla/file_restyles.html +++ b/dom/animation/test/mozilla/file_restyles.html @@ -1883,11 +1883,9 @@ waitForAllPaints(() => { await ensureElementRemoval(div); }); - // Tests that transform animations on a large size frame doesn't flush layout at all. - // - // With WebRender, the large size frame could run on compositor. - // Without WebRender, the large size frame is not able to run on the compositor - // due to layout restrictions. + // Tests that transform animations are not able to run on the compositor due + // to layout restrictions (e.g. animations on a large size frame) doesn't + // flush layout at all. add_task(async function flush_layout_for_transform_animations() { // Set layout.animation.prerender.partial to disallow transform animations // on large frames to be sent to the compositor. @@ -1907,11 +1905,7 @@ waitForAllPaints(() => { 'Flush layout is needed for the appended div'); await waitForAnimationReadyToRestyle(animation); - if (isWebRender) { - ok(SpecialPowers.wrap(animation).isRunningOnCompositor); - } else { - ok(!SpecialPowers.wrap(animation).isRunningOnCompositor); - } + ok(!SpecialPowers.wrap(animation).isRunningOnCompositor); ok(!SpecialPowers.DOMWindowUtils.needsFlush(FLUSH_LAYOUT), 'No further flush layout needed');