Update WPT mediacapture-streams tests
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / mediacapture-streams / MediaDevices-getSupportedConstraints.https.html
1 <!doctype html>
2 <html>
3 <head>
4 <title>Test navigator.mediaDevices.getSupportedConstraints()</title>
5 <link rel="help" href="https://w3c.github.io/mediacapture-main/#enumerating-devices">
6 <meta name='assert' content='Test the getSupportedConstraints() method.'/>
7 </head>
8 <body>
9 <h1 class="instructions">Description</h1>
10 <p class="instructions">This test checks for the presence of the
11 <code>navigator.mediaDevices.getSupportedConstraints()</code> method.</p>
12 <div id='log'></div>
13 <script src=/resources/testharness.js></script>
14 <script src=/resources/testharnessreport.js></script>
15 <script>
16 "use strict";
17 test(() => {
18   assert_inherits(navigator.mediaDevices, "getSupportedConstraints");
19   assert_equals(typeof navigator.mediaDevices.getSupportedConstraints, "function");
20 }, "navigator.mediaDevices.getSupportedConstraints exists");
21
22 {
23   const properties = [
24     "width",
25     "height",
26     "aspectRatio",
27     "frameRate",
28     "facingMode",
29     "resizeMode",
30     "sampleRate",
31     "sampleSize",
32     "echoCancellation",
33     "autoGainControl",
34     "noiseSuppression",
35     "latency",
36     "channelCount",
37     "deviceId",
38     "groupId"];
39   properties.forEach(property => {
40     test(()=>{
41       const supportedConstraints = navigator.mediaDevices.getSupportedConstraints();
42       assert_true(supportedConstraints[property]);
43     }, property + " is supported");
44   });
45 }
46 </script>
47 </body>
48 </html>