libservo: Trigger a rendering update when waiting for paint readiness in WebView unit tests #40712
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some unit tests attempt to wait for the WebView to be paint ready before
executing. The previous code would wait for a frame ready message from
the WebView before running, but this was subject to timing issues due to
the frame being sent before the load complete message. This changes
makes it so that the WebView explicitly triggers another rendering
update and then waits for a frame. It should be guaranteed that the next
frame will be one that reflects load completeness.
Special thanks to jmunroe on Zulip for investigation into this issue.
Testing: This seems to eliminate flaky timeouts on my machine. I ran
the unit tests in a loop, stopping if any error (such as a timeout happened).
Before this would stop within a minute or two, but I could not reproduce
the issue with this change after several minutes.