-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Reftests for font loading #11476
Description
This has come up several times recently.
At the moment, we can't test font loading with reftests because they are defined to wait on fonts loading.
That said, as long as we want it to be possible to run tests over WebDriver this will always be difficult given WebDriver doesn't provide us with any timing guarantees. As I wrote in an email recently:
in the case of any runner based on WebDriver we basically cannot provide strong guarantees about screenshot timing (the worst case is arguably something like wptrunner running Chrome on Android: the JS calls the execute async script callback, which then has to pass over the USB connection to the adb host, then get processed by ChromeDriver (when ChromeDriver receives the message, this has now completed the CDP communication and the browser will go back to spinning the event loop, AIUI), which then gets sent on to wptrunner over a TCP/IP socket, which then sends a request to ChromeDriver to take a screenshot, which then sends a CDP message (pausing the event loop, AIUI) to take a screenshot, etc. The more latency there is in this system the less we have guarantees about timing, and the harder it is to take screenshots at exact times to test things like font loading.
cc/ @foolip @fred-wang @Hexcles @youennf @jgraham @thejohnjansen