Closed Bug 1545309 Opened 5 months ago Closed 5 months ago

Fix the intermittent failure of resize-observer/eventloop.html

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: boris, Assigned: boris)

References

Details

Attachments

(2 files)

After introducing the ResizeObserver in Bug 1272409, we still one failure in eventloop.html:
assert_equals(helper.rafCount, 1, "new loop"); in test0 [1].

We fire this event in the next Tick(), but we call the callback of requestAnimationFrame() after several Tick()s, so helper.rafCount is still 0 in this case. This may be a bug of the test because using requestAnimationFrame() cannot reflect the next event loop, or our scheduling of ResizeObserver is not correct.

I can reproduce this 100% in local build (on linux and mac), but on try servers, it is an intermittent failure on all platforms.

[1] https://searchfox.org/mozilla-central/rev/ee3905439acbf81e9c829ece0b46d09d2fa26c5c/testing/web-platform/tests/resize-observer/eventloop.html#104

In test0(), we use the callback of requestAnimationFrame to know in which
eventloop (i.e. Tick()) we are. However, we may not trigger the callback
of requestAnimationFrame if we are not visible. This is an optimization
from Bug 1145439.

We use Document::ShouldThrottleFrameRequests() to check if we should throttle
the frame requests in the current Tick(). One of the cases is: if we didn't
get painted during the last paint, so we are not visible. We have to throttle
the frame requests. Note that because we have to paint this document at least
once to unthrottle it, we will drop one requestAnimationFrame frame when a
document that previously wasn't visible scrolls into view.

Therefore, we should make sure we got the first paint before running test0().

Assignee: nobody → boris.chiou
Attachment #9062375 - Attachment description: Bug 1545309 - Force first paint for ResizeObserver eventloop test. → Bug 1545309 - Run ResizeObserver eventloop test after loading successfully.
Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57b5cbfc0d7a
Make test function independent from others in eventloop.html. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/2c165cc03911
Run ResizeObserver eventloop test after loading successfully. r=dholbert
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16884 for changes under testing/web-platform/tests
Upstream PR merged
You need to log in before you can comment on or make changes to this bug.