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 <[email protected]>
Quick-Run: Tony Herre <[email protected]>
Auto-Submit: Tony Herre <[email protected]>
Commit-Queue: Florent Castelli <[email protected]>
Reviewed-by: Florent Castelli <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1054231}
  • Loading branch information
Tony Herre authored and chromium-wpt-export-bot committed Oct 3, 2022
1 parent b6c22f8 commit 39cab52
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions mediacapture-fromelement/idlharness.window.js
Original file line number Diff line number Diff line change
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 39cab52

Please sign in to comment.