Skip to content

Commit

Permalink
Fix element capture WPT ref to none existent media element
Browse files Browse the repository at this point in the history
This test was previously failing on all browsers due to testing a
<media> element had a captureStream() method. Fix it to use the
actually defined elements - <audio> and <video>.

Bug: 1370554,b/250598814
Change-Id: I961273f32c95459ca5e38cdaacab7512742026b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3932904
Commit-Queue: Tony Herre <toprice@chromium.org>
Quick-Run: Tony Herre <toprice@chromium.org>
Auto-Submit: Tony Herre <toprice@chromium.org>
Commit-Queue: Florent Castelli <orphis@chromium.org>
Reviewed-by: Florent Castelli <orphis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1054231}
  • Loading branch information
Tony Herre authored and Chromium LUCI CQ committed Oct 3, 2022
1 parent 4171160 commit 6c88296
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 39 deletions.

This file was deleted.

Expand Up @@ -9,11 +9,16 @@ idl_test(
['mediacapture-fromelement'],
['mediacapture-streams', 'html', 'dom'],
idl_array => {
// Ignored errors will be surfaced when media/canvas undefined below.
// Ignored errors will be surfaced when the elements are undefined below.
try {
self.media = document.createElement('media');
media.width = media.height = 10;
document.body.appendChild(media);
self.video = document.createElement('video');
video.width = video.height = 10;
document.body.appendChild(video);
} catch (e) { }

try {
self.audio = document.createElement('audio');
document.body.appendChild(audio);
} catch (e) { }

try {
Expand All @@ -24,7 +29,8 @@ idl_test(
} catch (e) { }

idl_array.add_objects({
HTMLMediaElement: ['media'],
HTMLVideoElement: ['video'],
HTMLAudioElement: ['audio'],
HTMLCanvasElement: ['canvas'],
CanvasCaptureMediaStreamTrack: ['track'],
});
Expand Down

0 comments on commit 6c88296

Please sign in to comment.