Bug 1442063 - Don't call FlushRendering() after we reached the state of STATE_WAITING_TO_FINISH. r?dbaron
Once we reached the state of STATE_WAITING_TO_FINISH, we just need to wait for
the final MozAfterPaint which is corresponding to flushRendering() after
"reftest-wait" removal.
MozReview-Commit-ID: EJxDYUnqbmr
--- a/layout/tools/reftest/reftest-content.js
+++ b/layout/tools/reftest/reftest-content.js
@@ -577,17 +577,21 @@ function WaitForTestEnd(contentRootEleme
// change from returning true to returning false is monitored via some kind
// of event listener which eventually calls this function.
function MakeProgress() {
if (state >= STATE_COMPLETED) {
LogInfo("MakeProgress: STATE_COMPLETED");
return;
}
- FlushRendering();
+ // We don't need to flush styles any more when we are in the state
+ // after reftest-wait has removed.
+ if (state != STATE_WAITING_TO_FINISH) {
+ FlushRendering();
+ }
switch (state) {
case STATE_WAITING_TO_FIRE_INVALIDATE_EVENT: {
LogInfo("MakeProgress: STATE_WAITING_TO_FIRE_INVALIDATE_EVENT");
if (shouldWaitForExplicitPaintWaiters() || shouldWaitForPendingPaints()) {
gFailureReason = "timed out waiting for pending paint count to reach zero";
if (shouldWaitForExplicitPaintWaiters()) {
gFailureReason += " (waiting for MozPaintWaitFinished)";