tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

GUM-echoCancellation-boolean.https.html (1414B)


      1 <!doctype html>
      2 <title>getUserMedia echoCancellation remote-only</title>
      3 <p class="instructions">When prompted, accept to share your audio stream.</p>
      4 <meta name=timeout content=long>
      5 <script src=/resources/testharness.js></script>
      6 <script src=/resources/testharnessreport.js></script>
      7 <script src=/resources/testdriver.js></script>
      8 <script src=/resources/testdriver-vendor.js></script>
      9 <script src=permission-helper.js></script>
     10 <script>
     11  'use strict'
     12 
     13  // https://w3c.github.io/mediacapture-main/#dfn-echocancellation
     14 
     15  promise_test(async t => {
     16    await setMediaPermission("granted", ["microphone"]);
     17    const stream = await navigator.mediaDevices.getUserMedia({
     18      video: false,
     19      audio: {echoCancellation: {exact: true}},
     20    });
     21    const track = stream.getAudioTracks()[0];
     22    t.add_cleanup(() => track.stop());
     23    const settings = track.getSettings();
     24    assert_equals(settings.echoCancellation, true);
     25  }, 'getUserMedia suports true');
     26 
     27  promise_test(async t => {
     28    await setMediaPermission("granted", ["microphone"]);
     29    const stream = await navigator.mediaDevices.getUserMedia({
     30      video: false,
     31      audio: {echoCancellation: {exact: false}},
     32    });
     33    const track = stream.getAudioTracks()[0];
     34    t.add_cleanup(() => track.stop());
     35    const settings = track.getSettings();
     36    assert_equals(settings.echoCancellation, false);
     37  }, 'getUserMedia suports false');
     38 
     39 </script>