diff --git a/dom/media/MediaDevices.cpp b/dom/media/MediaDevices.cpp index 2cb5d443468f5..8164ec871fd9d 100644 --- a/dom/media/MediaDevices.cpp +++ b/dom/media/MediaDevices.cpp @@ -270,7 +270,7 @@ RefPtr MediaDevices::FilterExposedDevices( if (mCanExposeMicrophoneInfo) { exposedMicrophoneGroupIds.Insert(device->mRawGroupID); } - if (!DeviceInformationCanBeExposed() && !legacy) { + if (!mCanExposeMicrophoneInfo && !legacy) { dropMics = true; } break; @@ -278,7 +278,7 @@ RefPtr MediaDevices::FilterExposedDevices( if (dropCams) { continue; } - if (!DeviceInformationCanBeExposed() && !legacy) { + if (!mCanExposeCameraInfo && !legacy) { dropCams = true; } break; diff --git a/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html b/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html index 1007f053ea2e7..88c07048a1b48 100644 --- a/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html +++ b/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html @@ -71,9 +71,12 @@

Description

const stream = await navigator.mediaDevices.getUserMedia({ audio: true }); stream.getTracks()[0].stop(); const devices = await navigator.mediaDevices.enumerateDevices(); - assert_equals(devices.filter(({kind}) => kind != "audiooutput").length, - devices1.filter(({kind}) => kind != "audiooutput").length, - "same number of input devices"); + assert_equals(devices.filter(({kind}) => kind == "videoinput").length, + devices1.filter(({kind}) => kind == "videoinput").length, + "same number of (previously exposed) videoinput devices"); + assert_greater_than_equal(devices.filter(d => d.kind == "audioinput").length, + devices1.filter(d => d.kind == "audioinput").length, + "same number or more audioinput devices"); const order = ["audioinput", "videoinput", "audiooutput"]; for (const {kind, deviceId} of devices) { assert_in_array(kind, order, "expected kind");