summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-mic.https.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-mic.https.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-mic.https.html')
-rw-r--r--testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-mic.https.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-mic.https.html b/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-mic.https.html
new file mode 100644
index 0000000000..d45fd740e8
--- /dev/null
+++ b/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-mic.https.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<html>
+<head>
+<title>enumerateDevices: test enumerateDevices should not expose microphone devices if they are not allowed by Permissions-Policy header</title>
+<link rel="help" href="https://w3c.github.io/mediacapture-main/#dom-mediadevices-enumeratedevices">
+<meta name='assert' content='Check that the enumerateDevices() method should not expose microphone devices when blocked by Permissions-Policy header.'/>
+</head>
+<body>
+<h1 class="instructions">Description</h1>
+<p class="instructions">This test checks for the absence of microphone in
+<code>navigator.mediaDevices.enumerateDevices()</code> method when blocked by Permissions-Policy header.</p>
+<div id='log'></div>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<script>
+"use strict";
+promise_test(async () => {
+ assert_not_equals(navigator.mediaDevices.enumerateDevices, undefined, "navigator.mediaDevices.enumerateDevices exists");
+ const deviceList = await navigator.mediaDevices.enumerateDevices();
+ for (const mediaInfo of deviceList) {
+ assert_not_equals(mediaInfo.deviceId, undefined, "mediaInfo's deviceId should exist.");
+ assert_not_equals(mediaInfo.kind, undefined, "mediaInfo's kind should exist.");
+ assert_not_equals(mediaInfo.label, undefined, "mediaInfo's label should exist.");
+ assert_not_equals(mediaInfo.groupId, undefined, "mediaInfo's groupId should exist.");
+ assert_in_array(mediaInfo.kind, ["videoinput", "audiooutput"]);
+ }
+}, "Microphone is not exposed in mediaDevices.enumerateDevices() when blocked by Permissions-Policy");
+</script>
+</body>
+</html>