Skip to content

Commit

Permalink
Improve error resilience for resize-during-playback.html test.
Browse files Browse the repository at this point in the history
This ensures the event watcher is registered before events may
be generated and ensures an error event doesn't cause a timeout.

R=tguilbert

Bug: 1489726
Change-Id: I4bbdbce140684f72c994fe37f443955f49116826
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4917304
Auto-Submit: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Thomas Guilbert <tguilbert@chromium.org>
Reviewed-by: Thomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1206066}
  • Loading branch information
dalecurtis authored and chromium-wpt-export-bot committed Oct 5, 2023
1 parent 0a5ef44 commit ee1fcf6
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
const video = document.createElement('video');
assert_implements_optional(video.canPlayType(`video/${format}`), `${format} supported`);

const eventWatcher = new EventWatcher(t, video, ['resize', 'playing', 'error', 'ended']);

// Load the video and wait for initial resize event.
video.src = `/media/400x300-red-resize-200x150-green.${format}`;
video.muted = true;
video.preload = 'auto';
video.onerror = t.unreached_func("error during playback");
video.src = `/media/400x300-red-resize-200x150-green.${format}`;
document.body.appendChild(video);
const eventWatcher = new EventWatcher(t, video, ['resize', 'playing', 'error', 'ended']);

await eventWatcher.wait_for(['resize']);
assert_equals(video.videoWidth, 400, 'width after first resize event');
assert_equals(video.videoHeight, 300, 'height after first resize event');
Expand Down

0 comments on commit ee1fcf6

Please sign in to comment.