diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-camera.https.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-camera.https.html')
-rw-r--r-- | testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-camera.https.html | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-camera.https.html b/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-camera.https.html new file mode 100644 index 0000000000..1bb086dadd --- /dev/null +++ b/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices-not-allowed-camera.https.html @@ -0,0 +1,30 @@ +<!doctype html> +<html> +<head> +<title>enumerateDevices: test enumerateDevices should not expose camera devices if they are not allowed to use</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 exposed camera devices.'/> +</head> +<body> +<h1 class="instructions">Description</h1> +<p class="instructions">This test checks for the presence of camera in +<code>navigator.mediaDevices.enumerateDevices()</code> method.</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, ["audioinput", "audiooutput"]); + } +}, "Camera is not exposed in mediaDevices.enumerateDevices()"); +</script> +</body> +</html> |