Closed Bug 2062191 Opened 29 days ago Closed 25 days ago

browser_ext_webrtc.js does not set media.navigator.streams.fake, so its successful getUserMedia() call fails on macOS

Categories

(WebExtensions :: Frontend, defect, P3)

defect

Tracking

(firefox156 fixed)

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

The test sets media.navigator.permission.fake but not media.navigator.streams.fake, so its last getUserMedia() call, the one expected to succeed from a browserAction popup holding a persisted microphone permission, goes through the real device path. WebRTCParent's checkOSPermission() only bypasses the OS authorization check when streams.fake is set, and on non-mac the check cannot fail because nsOSPermissionRequestBase returns PERMISSION_STATE_AUTHORIZED unconditionally; only macOS overrides it. On macOS the request is answered with getUserMedia:response:noOSPermission, which MediaManager turns into a NotFoundError and the test reports as "Failed with error The object can not be found here." Measured 12/12 runs on macosx1015-64-qr opt and debug.

The per-test failure profile settles the ambiguity with an empty device enumeration, which produces the same NotFoundError: four getUserMedia:request notifications, three :response:deny (the expected NotAllowedErrors) and exactly one :response:noOSPermission.

Bug 1565738's own landed fix (2019-09-25) is that streams.fake bypass, and it re-enabled browser/base/content/test/webrtc/, whose head.js sets both prefs. This test landed eight days earlier already carrying the mac skip and referencing that bug, and was never revisited.

Setting streams.fake also removes the dependency on a real audio input device: 1/1 fail without it on a machine with no microphone, 5/5 pass with it. All three mac conditions are removed, on the grounds that the macOS TCC check is not OS-version specific; only 10.15 is verifiable from a default try push.

Assignee: nobody → florian
Status: NEW → ASSIGNED

The test set media.navigator.permission.fake but not
media.navigator.streams.fake, so its last getUserMedia() call - the one
that is expected to succeed, from a browserAction popup holding a
persisted microphone permission - went through the real device path.

On macOS that call never succeeds in automation. WebRTCParent.prompt()
takes the addon popup branch, checkRequestAllowed() finds the ALLOW
permission, and then checkOSPermission() consults the OS camera/microphone
authorization state. That check is only bypassed when
media.navigator.streams.fake is set, and on non-mac it cannot fail at all
because nsOSPermissionRequestBase returns PERMISSION_STATE_AUTHORIZED
unconditionally; only macOS overrides it. So on macOS the request is
answered with getUserMedia:response:noOSPermission, which MediaManager
turns into a NotFoundError, and the test reports "Failed with error The
object can not be found here.".

Without streams.fake the test fails 12/12 on macosx1015-64-qr opt and
debug on try, and 1/1 on a linux workstation with no microphone; with it,
5/5 locally.

Only mac 10.15 can be exercised from a default try push. The 15.30 aarch64
condition is removed on the grounds that the mechanism is the macOS TCC
check and is not OS-version specific; the 14.70 one is removed because
macosx1470 runs no mochitest-browser-chrome job, so it matches nothing.

Severity: -- → N/A
Priority: -- → P3
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f22844d2d7c4 https://hg.mozilla.org/integration/autoland/rev/1c346518c675 Use fake media streams in browser_ext_webrtc.js and re-enable it on mac, r=extension-reviewers,rpl.

Backed out for causing bc failures @browser_ext_url_overrides_newtab.js.

Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/34deaa65f4f1 https://hg.mozilla.org/integration/autoland/rev/7b82bb967794 Use fake media streams in browser_ext_webrtc.js and re-enable it on mac, r=extension-reviewers,rpl.
Status: ASSIGNED → RESOLVED
Closed: 25 days ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch

Authored by https://github.com/fqueze
https://github.com/mozilla/enterprise-firefox/commit/34deaa65f4f10f1f5d49e8dd6f3b20234c5706f1
[enterprise-main] Bug 2062191 - Use fake media streams in browser_ext_webrtc.js and re-enable it on mac, r=extension-reviewers,rpl.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: