Closed Bug 986367 Opened 11 years ago Closed 11 years ago

paint_listener.js should ensure that paint suppression is not in place

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla31

People

(Reporter: birtles, Assigned: birtles)

References

Details

Attachments

(1 file)

In debugging test failures for bug 975261 on B2G I spent a lot of time chasing down a situation where painting wasn't happening in time. The cause turned out to be using paint_listener inside an onload handler which is run before nsDocumentViewer::LoadComplete unsuppresses painting. We should make paint_listener.js check for paint suppression. At very least it should fail loudly. Better yet, it should actually wait until paint suppression has finished.
This patch adds an extra check for paint suppression when waiting for paint events. This is because on some platforms (notably B2G) we can think all paints have completed because paint suppression is in effect and as a result call the callback too soon. This patch use window.setTimeout(..., 0) to wait for paint suppression to finish before preceding to check for pending paint events. When the refresh driver is under test control, if we detect that paint events are pending we need to force a refresh driver tick. This patch adds that tick. I suppose we had previously never hit this situation before and never noticed this. This patch also rearranges the main loop so that early returns appear first and calling the callback appears at the end.
Attachment #8396105 - Flags: review?(matt.woodrow)
Attachment #8396105 - Flags: review?(matt.woodrow) → review+
Blocks: 964646
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: