tor-browser

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

test_peerConnection_setRemoteAnswerInStable.html (882B)


      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: "784519",
     11    title: "setRemoteDescription (answer) in 'stable'"
     12  });
     13 
     14 runNetworkTest(function () {
     15  const test = new PeerConnectionTest();
     16  test.setMediaConstraints([{audio: true}], [{audio: true}]);
     17  test.chain.removeAfter("PC_LOCAL_CREATE_OFFER");
     18 
     19  test.chain.append([
     20    function PC_LOCAL_SET_REMOTE_ANSWER(test) {
     21      test.pcLocal._latest_offer.type = "answer";
     22      test.pcLocal._pc.setRemoteDescription(test.pcLocal._latest_offer)
     23        .then(generateErrorCallback('setRemoteDescription should fail'),
     24              err =>
     25              is(err.name, "InvalidStateError", "Error is InvalidStateError"));
     26    }
     27  ]);
     28 
     29  return test.run();
     30 });
     31 </script>
     32 </pre>
     33 </body>
     34 </html>