tor-browser

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

test_peerConnection_restartIceLocalRollbackNoSubsequentRestart.html (1900B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <script type="application/javascript" src="pc.js"></script>
      5 </head>
      6 <body>
      7 <pre id="test">
      8 <script type="application/javascript">
      9  createHTML({
     10    bug: "906986",
     11    title: "Renegotiation: restart ice, local rollback, then renegotiation without ICE restart"
     12  });
     13 
     14  var test;
     15  runNetworkTest(function (options) {
     16    test = new PeerConnectionTest(options);
     17 
     18    addRenegotiation(test.chain,
     19      [
     20        // causes a full, normal ice restart
     21        function PC_LOCAL_SET_OFFER_OPTION(test) {
     22          test.setOfferOptions({ iceRestart: true });
     23        },
     24        // causes an ice restart and then rolls it back
     25        // (does not result in sending an offer)
     26        function PC_LOCAL_SETUP_ICE_HANDLER(test) {
     27          test.pcLocal.setupIceCandidateHandler(test, () => {});
     28        },
     29        function PC_LOCAL_CREATE_AND_SET_OFFER(test) {
     30          return test.createOffer(test.pcLocal).then(offer => {
     31            return test.setLocalDescription(test.pcLocal,
     32                                            offer,
     33                                            HAVE_LOCAL_OFFER);
     34          });
     35        },
     36        function PC_LOCAL_WAIT_FOR_END_OF_TRICKLE(test) {
     37          return test.pcLocal.endOfTrickleIce;
     38        },
     39        function PC_LOCAL_ROLLBACK(test) {
     40          return test.setLocalDescription(test.pcLocal,
     41                                          { type: "rollback", sdp: ""},
     42                                          STABLE);
     43        },
     44        function PC_LOCAL_SET_OFFER_OPTION(test) {
     45          test.setOfferOptions({ iceRestart: false });
     46        }
     47      ]
     48    );
     49 
     50    // for now, only use one stream, because rollback doesn't seem to
     51    // like multiple streams.  See bug 1259465.
     52    test.setMediaConstraints([{audio: true}],
     53                             [{audio: true}]);
     54    return test.run();
     55  });
     56 
     57 </script>
     58 </pre>
     59 </body>
     60 </html>