Skip to content

Commit

Permalink
Don't use await for video.play() promise. (KhronosGroup#3263)
Browse files Browse the repository at this point in the history
Some tests are finishing as soon as the first frame has come in
and triggering a pause() or other condition which thorws a
'AssertionError: Video failed to play(): AbortError: The play()
request was interrupted by a call to pause().' error.

So just check for no sources and use the error handler like we
do on older WebGL test versions.

Addresses new failures seen while rolling forward WebGL
conformance in Chromium:
https://chromium-review.googlesource.com/2775887/
for http://crbug.com/1136205 .
  • Loading branch information
dalecurtis authored Mar 19, 2021
1 parent 9174c56 commit aea189a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sdk/tests/js/webgl-test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3132,7 +3132,12 @@ var runSteps = function(steps) {
* @param {!function(!HTMLVideoElement): void} callback Function to call when
* video is ready.
*/
async function startPlayingAndWaitForVideo(video, callback) {
function startPlayingAndWaitForVideo(video, callback) {
if (video.error) {
testFailed('Video failed to load: ' + video.error);
return;
}

video.addEventListener(
'error', e => { testFailed('Video playback failed: ' + e.message); },
true);
Expand All @@ -3157,11 +3162,7 @@ async function startPlayingAndWaitForVideo(video, callback) {
video.muted = true;
// See whether setting the preload flag de-flakes video-related tests.
video.preload = 'auto';
try {
await video.play();
} catch (error) {
testFailed('Video failed to play(): ' + error);
}
video.play();
};

var getHost = function(url) {
Expand Down

0 comments on commit aea189a

Please sign in to comment.