tor-browser

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

test_getUserMedia_spinEventLoop.html (773B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <script type="application/javascript" src="mediaStreamPlayback.js"></script>
      5 </head>
      6 <body>
      7 <pre id="test">
      8 <script type="application/javascript">
      9  createHTML({ title: "getUserMedia Basic Audio Test", bug: "1208656" });
     10  /**
     11   * Run a test to verify that we can spin the event loop from within a mozGUM callback.
     12   */
     13  runTest(() => {
     14    var testAudio = createMediaElement('audio', 'testAudio');
     15    return new Promise((resolve, reject) => {
     16      navigator.mediaDevices.getUserMedia({ audio: true }).then(stream => {
     17        SpecialPowers.spinEventLoop(window);
     18        ok(true, "Didn't crash");
     19        stream.getTracks().forEach(t => t.stop());
     20        resolve();
     21      }, () => {});
     22    });
     23  });
     24 
     25 </script>
     26 </pre>
     27 </body>
     28 </html>