Skip to content

Commit

Permalink
Bug 1528042 - Add successful gUM calls to existing WPT and mochitests…
Browse files Browse the repository at this point in the history
… to let them continue to test full device information exposure in enumerateDevices(). r=karlt

This is required by spec. See
w3c/mediacapture-main#641 and
w3c/mediacapture-main#773 for details.

Also fixes test_enumerateDevices_getUserMediaFake.html to run on macOS outside automation.

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

UltraBlame original commit: 59b9147c85f0fc893bab3ab9baa431d66bfb25cb
  • Loading branch information
marco-c committed May 18, 2023
1 parent a394dd9 commit 815c5fc
Show file tree
Hide file tree
Showing 8 changed files with 506 additions and 269 deletions.
119 changes: 93 additions & 26 deletions dom/media/webrtc/tests/mochitests/test_enumerateDevices.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
}
}
}
var
const
gUM
=
c
Expand All @@ -230,9 +230,23 @@
c
)
;
var
validateDevice
const
kinds
=
[
"
videoinput
"
"
audioinput
"
"
audiooutput
"
]
;
function
validateDevice
(
{
kind
Expand All @@ -241,25 +255,15 @@
groupId
}
)
=
>
{
ok
(
kinds
.
includes
(
kind
=
=
"
videoinput
"
|
|
kind
=
=
"
audioinput
"
)
"
Known
device
Expand Down Expand Up @@ -347,7 +351,41 @@
Validate
enumerated
devices
after
gUM
.
for
(
const
track
of
(
await
gUM
(
{
video
:
true
audio
:
true
}
)
)
.
getTracks
(
)
)
{
track
.
stop
(
)
;
}
let
devices
=
Expand All @@ -374,7 +412,7 @@
"
)
;
let
const
jsoned
=
JSON
Expand Down Expand Up @@ -433,7 +471,7 @@
;
for
(
let
const
device
of
devices
Expand All @@ -444,6 +482,19 @@
device
)
;
if
(
device
.
kind
=
=
"
audiooutput
"
)
continue
;
/
/
Test
Expand Down Expand Up @@ -488,7 +539,7 @@
;
for
(
let
const
track
of
(
Expand Down Expand Up @@ -771,7 +822,7 @@
location
)
;
let
const
haveDevicesMap
=
new
Expand All @@ -781,7 +832,7 @@
=
>
{
let
const
map
=
new
Expand Down Expand Up @@ -871,7 +922,7 @@
=
>
{
let
const
iframe
=
document
Expand Down Expand Up @@ -899,6 +950,10 @@
camera
;
microphone
;
speaker
-
selection
"
;
info
Expand Down Expand Up @@ -970,6 +1025,12 @@
devices
.
length
"
same
origin
same
devices
"
)
;
is
Expand All @@ -980,6 +1041,12 @@
devices
.
length
"
cross
origin
same
devices
"
)
;
[
Expand All @@ -1006,7 +1073,7 @@
;
for
(
let
const
device
of
sameOriginDevices
Expand Down Expand Up @@ -1050,7 +1117,7 @@
}
for
(
let
const
device
of
differentOriginDevices
Expand Down
Loading

0 comments on commit 815c5fc

Please sign in to comment.