MediaDevices-getSupportedConstraints.https.html (1407B)
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 "voiceIsolation", 36 "latency", 37 "channelCount", 38 "deviceId", 39 "groupId"]; 40 properties.forEach(property => { 41 test(()=>{ 42 const supportedConstraints = navigator.mediaDevices.getSupportedConstraints(); 43 assert_true(supportedConstraints[property]); 44 }, property + " is supported"); 45 }); 46 } 47 </script> 48 </body> 49 </html>