tor-browser

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

test_AudioParamDevtoolsAPI.html (1526B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Test the devtool AudioParam API</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      7 </head>
      8 <body>
      9 <pre id="test">
     10 <script class="testbody" type="text/javascript">
     11 
     12  function checkIdAndName(node, name) {
     13    is(SpecialPowers.getPrivilegedProps(node, "id"),
     14       SpecialPowers.getPrivilegedProps(node[name], "parentNodeId"),
     15       "The parent id should be correct");
     16    is(SpecialPowers.getPrivilegedProps(node[name], "name"), name,
     17       "The name of the AudioParam should be correct.");
     18  }
     19 
     20  var ac = new AudioContext(),
     21      gain = ac.createGain(),
     22      osc = ac.createOscillator(),
     23      del = ac.createDelay(),
     24      source = ac.createBufferSource(),
     25      stereoPanner = ac.createStereoPanner(),
     26      comp = ac.createDynamicsCompressor(),
     27      biquad = ac.createBiquadFilter();
     28 
     29  checkIdAndName(gain, "gain");
     30  checkIdAndName(osc, "frequency");
     31  checkIdAndName(osc, "detune");
     32  checkIdAndName(del, "delayTime");
     33  checkIdAndName(source, "playbackRate");
     34  checkIdAndName(source, "detune");
     35  checkIdAndName(stereoPanner, "pan");
     36  checkIdAndName(comp, "threshold");
     37  checkIdAndName(comp, "knee");
     38  checkIdAndName(comp, "ratio");
     39  checkIdAndName(comp, "attack");
     40  checkIdAndName(comp, "release");
     41  checkIdAndName(biquad, "frequency");
     42  checkIdAndName(biquad, "detune");
     43  checkIdAndName(biquad, "Q");
     44  checkIdAndName(biquad, "gain");
     45 
     46 </script>
     47 </pre>
     48 </body>
     49 </html>