Commit cadc3b5f authored by Austin Orion's avatar Austin Orion Committed by Commit Bot

Wait for thumbnail to paint in web tests to reduce flakiness.

A couple of pixel-diff web tests that load videos are flakily failing
when the video thumbnail doesn't load before the test completes. This
change adds a call to requestAnimationFrame(), this will delay test
completion until the next paint event which should ensure the thumbnail
has time to render.

These are the specific tests and examples of this failure:
media/track/track-cue-rendering-vertical.html
Actual output:
https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=f442e58feefd4b369fe10ad79d0a08fd06c52e98&as=layout-test-results%5Cvirtual%5Caudio-service%5Cmedia%5Ctrack%5Ctrack-cue-rendering-vertical-actual.png
Expected output:
https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=1825086dd5eba7e7f44f92eb65f8a7d96d4d96a9&as=layout-test-results%5Cvirtual%5Caudio-service%5Cmedia%5Ctrack%5Ctrack-cue-rendering-vertical-expected.png

media/video-display-toggle.html
Actual output:
https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=8af52e11ce9cde942897c679774a0cb7ee7defe2&as=layout-test-results%5Cvirtual%5Caudio-service%5Cmedia%5Cvideo-display-toggle-actual.png
Expected output:
https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=a3189550a01f577a6eb50ff52c912dee59a840bc&as=layout-test-results%5Cvirtual%5Caudio-service%5Cmedia%5Cvideo-display-toggle-expected.png

Change-Id: I005c4795bf08a26dd3555f7e5050172897660dd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1901643Reviewed-by: default avatarChrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Austin Orion <auorion@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#714025}
parent 74a8f73b
...@@ -9,7 +9,10 @@ video.src = "../content/test.ogv"; ...@@ -9,7 +9,10 @@ video.src = "../content/test.ogv";
testRunner.waitUntilDone(); testRunner.waitUntilDone();
video.onseeked = function() { video.onseeked = function() {
testRunner.notifyDone(); // Wait for one rAF to ensure the thumbnail is onscreen, which helps reduce
// flaky failures.
if (window.testRunner)
requestAnimationFrame(_ => testRunner.notifyDone());
} }
video.currentTime = 0.75; video.currentTime = 0.75;
......
...@@ -30,8 +30,10 @@ ...@@ -30,8 +30,10 @@
} }
function done() function done()
{ {
// Wait for one rAF to ensure the thumbnail is onscreen, which
// helps reduce flaky failures.
if (window.testRunner) if (window.testRunner)
testRunner.notifyDone(); requestAnimationFrame(_ => testRunner.notifyDone());
} }
</script> </script>
</head> </head>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment