diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/media/webrtc/tests/mochitests/test_getUserMedia_bug1223696.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/webrtc/tests/mochitests/test_getUserMedia_bug1223696.html')
-rw-r--r-- | dom/media/webrtc/tests/mochitests/test_getUserMedia_bug1223696.html | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/dom/media/webrtc/tests/mochitests/test_getUserMedia_bug1223696.html b/dom/media/webrtc/tests/mochitests/test_getUserMedia_bug1223696.html new file mode 100644 index 0000000000..6af7b69d70 --- /dev/null +++ b/dom/media/webrtc/tests/mochitests/test_getUserMedia_bug1223696.html @@ -0,0 +1,54 @@ +<!DOCTYPE HTML> +<html> +<head> + <script type="application/javascript" src="mediaStreamPlayback.js"></script> + <script type="application/javascript" src="/tests/dom/canvas/test/captureStream_common.js"></script> +</head> +<body> +<pre id="test"> +<script type="application/javascript"> + "use strict"; + + createHTML({ + title: "Testing that removeTrack+addTrack of video tracks still render the correct track in a media element", + bug: "1223696", + visible: true + }); + + runTest(async function() { + const stream = await getUserMedia({audio:true, video: true}); + info("Test addTrack()ing a video track to an audio-only gUM stream"); + + const video = createMediaElement("video", "test_video_track"); + video.srcObject = stream; + video.play(); + + await haveEvent(video, "loadeddata", wait(5000, new Error("Timeout"))); + info("loadeddata"); + + const removedTrack = stream.getVideoTracks()[0]; + stream.removeTrack(removedTrack); + + const h = new CaptureStreamTestHelper2D(); + const emitter = new VideoFrameEmitter(h.grey, h.grey); + emitter.start(); + + stream.addTrack(emitter.stream().getVideoTracks()[0]); + + checkMediaStreamContains(stream, [stream.getAudioTracks()[0], + emitter.stream().getVideoTracks()[0]]); + + await h.pixelMustBecome(video, h.grey, { + threshold: 5, + infoString: "The canvas track should be rendered by the media element", + }); + + emitter.stop(); + for (const t of [removedTrack, ...stream.getAudioTracks()]) { + t.stop(); + } + }); +</script> +</pre> +</body> +</html> |