зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1523625 - Wait until the animation is on the compositor before testing if it is; r=hiro
This test was failing intermittently on GeckoView e10s. The waitForAnimationReadyToRestyle helper works around certain cases where, due to vsync, the animation ends up starting at exactly the same frame time as when it was created meaning that restyling may not get triggered and hence we won't have a chance to send it to the compositor. It's not clear why this happens more frequently on GeckoView e10s but this seems to fix the failures anyway. Differential Revision: https://phabricator.services.mozilla.com/D18043 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
08852a6035
Коммит
9e3969c99a
|
@ -4,6 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<title>DOMWindowUtils test with animation</title>
|
||||
<script src="/tests/SimpleTest/paint_listener.js"></script>
|
||||
<script src="/tests/dom/animation/test/testcommon.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script type="application/javascript">
|
||||
|
@ -188,28 +189,24 @@ function test_needsFlushWithThrottledAnimations() {
|
|||
|
||||
const animation = div.animate({ opacity: [ 0, 1 ] },
|
||||
{ duration: 100000, iterations: Infinity });
|
||||
animation.ready.then(() => {
|
||||
// Make sure pending styles in the previous test has been already processed.
|
||||
// (I.e. the target element in the test has surely removed.)
|
||||
waitForAllPaintsFlushed(() => {
|
||||
ok(SpecialPowers.wrap(animation).isRunningOnCompositor,
|
||||
"Opacity animation should run on the compositor");
|
||||
waitForAnimationReadyToRestyle(animation).then(() => {
|
||||
ok(SpecialPowers.wrap(animation).isRunningOnCompositor,
|
||||
"Opacity animation should run on the compositor");
|
||||
|
||||
// FIXME! Bug 1442861: We should make sure needsFlush() returns true
|
||||
// before flusing layout.
|
||||
//ok(utils.needsFlush(SpecialPowers.Ci.nsIDOMWindowUtils.FLUSH_STYLE),
|
||||
// "needsFlush should return true if there is an animation on the compositor");
|
||||
// FIXME! Bug 1442861: We should make sure needsFlush() returns true
|
||||
// before flusing layout.
|
||||
//ok(utils.needsFlush(SpecialPowers.Ci.nsIDOMWindowUtils.FLUSH_STYLE),
|
||||
// "needsFlush should return true if there is an animation on the compositor");
|
||||
|
||||
// Flush layout.
|
||||
document.documentElement.getBoundingClientRect();
|
||||
// Flush layout.
|
||||
document.documentElement.getBoundingClientRect();
|
||||
|
||||
ok(!utils.needsFlush(SpecialPowers.Ci.nsIDOMWindowUtils.FLUSH_STYLE),
|
||||
"needsFlush should return false after flushing layout");
|
||||
ok(!utils.needsFlush(SpecialPowers.Ci.nsIDOMWindowUtils.FLUSH_STYLE),
|
||||
"needsFlush should return false after flushing layout");
|
||||
|
||||
div.remove();
|
||||
next();
|
||||
window.close();
|
||||
});
|
||||
div.remove();
|
||||
next();
|
||||
window.close();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -236,6 +236,7 @@ support-files =
|
|||
file4_setting_opener.html
|
||||
PASS.html
|
||||
FAIL.html
|
||||
!/dom/animation/test/testcommon.js
|
||||
!/dom/events/test/event_leak_utils.js
|
||||
../../../browser/extensions/pdfjs/test/file_pdfjs_test.pdf
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ function test_getUnanimatedComputedStyle() {
|
|||
set: [
|
||||
["dom.animations-api.core.enabled", true],
|
||||
["dom.animations-api.getAnimations.enabled", true],
|
||||
["dom.animations-api.timelines.enabled", true],
|
||||
],
|
||||
},
|
||||
() => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче