tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit a34936b64c023e061e418bf53e958024d098a0b2
parent e8577e2415aa670712abdaa829389f03c2a97800
Author: Andreas Pehrson <apehrson@mozilla.com>
Date:   Tue, 14 Oct 2025 18:35:42 +0000

Bug 1771789 - Use "real fake" camera in some mochitests as loopback device does not work with native cloning. r=jib

Native cloning, which behaves like an independent gUM request, ends up using a
shared camera backend instance that is already live and does not need
reconfiguration.

The v4l2loopback device we set up on linux only issues a single frame during a
session. And since with deep cloning the session is reused, the new clone never
sees a frame, causing test_gUM_mediaStreamTrackClone.html, and intermittently
test_gUM_mediaElementCapture_tracks.html, to time out.

The "real fake" camera behaves like a normal camera in that it issues new frames
as requested, while still using the native capture stack.

Differential Revision: https://phabricator.services.mozilla.com/D266396

Diffstat:
Mdom/media/webrtc/tests/mochitests/test_getUserMedia_mediaElementCapture_tracks.html | 4++++
Mdom/media/webrtc/tests/mochitests/test_getUserMedia_mediaStreamTrackClone.html | 4++++
2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/dom/media/webrtc/tests/mochitests/test_getUserMedia_mediaElementCapture_tracks.html b/dom/media/webrtc/tests/mochitests/test_getUserMedia_mediaElementCapture_tracks.html @@ -22,6 +22,10 @@ let streamUntilEnded; const tracks = []; runTest(async () => { try { + await pushPrefs( + ["media.getusermedia.camera.fake.force", true], + ["media.video_loopback_dev", ""], + ); let stream = await getUserMedia({audio: true, video: true}); // We need to test with multiple tracks. We add an extra of each kind. for (const track of stream.getTracks()) { diff --git a/dom/media/webrtc/tests/mochitests/test_getUserMedia_mediaStreamTrackClone.html b/dom/media/webrtc/tests/mochitests/test_getUserMedia_mediaStreamTrackClone.html @@ -35,6 +35,10 @@ }); runTest(() => Promise.resolve() + .then(() => pushPrefs( + ["media.getusermedia.camera.fake.force", true], + ["media.video_loopback_dev", ""], + )) .then(() => testSingleTrackClonePlayback({audio: true})) .then(() => testSingleTrackClonePlayback({video: true})) .then(() => getUserMedia({video: true})).then(stream => {