tor-browser

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

test_peerConnection_addSecondVideoStreamNoBundle.html (2091B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <script type="application/javascript" src="pc.js"></script>
      5  <script type="application/javascript" src="/tests/dom/canvas/test/captureStream_common.js"></script>
      6 </head>
      7 <body>
      8 <pre id="test">
      9 <script type="application/javascript">
     10  createHTML({
     11    bug: "1017888",
     12    title: "Renegotiation: add second video stream, no bundle"
     13  });
     14 
     15  runNetworkTest(async function (options = {}) {
     16    // Use fake video here since the native fake device on linux doesn't
     17    // change color as needed by checkVideoPlaying() below.
     18    await pushPrefs(
     19      ['media.video_loopback_dev', ''],
     20      ['media.navigator.streams.fake', true]);
     21    // [TODO] re-enable HW decoder after bug 1526207 is fixed.
     22    if (navigator.userAgent.includes("Android")) {
     23      await pushPrefs(["media.navigator.mediadatadecoder_vpx_enabled", false],
     24                      ["media.webrtc.hw.h264.enabled", false]);
     25    }
     26 
     27    options.bundle = false;
     28    const test = new PeerConnectionTest(options);
     29    addRenegotiation(test.chain,
     30      [
     31        function PC_LOCAL_ADD_SECOND_STREAM(test) {
     32          test.setMediaConstraints([{video: true}, {video: true}],
     33                                   [{video: true}]);
     34          // Since this is a NoBundle variant, adding a track will cause us to
     35          // go back to checking.
     36          test.pcLocal.expectIceChecking();
     37          return test.pcLocal.getAllUserMediaAndAddStreams([{video: true}]);
     38        },
     39        function PC_REMOTE_EXPECT_ICE_CHECKING(test) {
     40          test.pcRemote.expectIceChecking();
     41        },
     42      ],
     43      [
     44        function PC_REMOTE_CHECK_VIDEO_FLOW(test) {
     45          const h = new VideoStreamHelper();
     46          is(test.pcRemote.remoteMediaElements.length, 2,
     47             "Should have two remote media elements after renegotiation");
     48          return Promise.all(test.pcRemote.remoteMediaElements.map(video =>
     49            h.checkVideoPlaying(video)));
     50        },
     51      ]
     52    );
     53 
     54    test.setMediaConstraints([{video: true}], [{video: true}]);
     55    await test.run();
     56  });
     57 </script>
     58 </pre>
     59 </body>
     60 </html>