mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
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
This commit is contained in:
parent
f35db66138
commit
cff6e480f0
@ -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');
|
||||
});
|
||||
}
|
||||
|
@ -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');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user