tor-browser

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

test_peerConnection_bug827843.html (1482B)


      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: "827843",
     11    title: "Ensure that localDescription and remoteDescription are null after close"
     12  });
     13 
     14 var steps = [
     15  function CHECK_SDP_ON_CLOSED_PC(test) {
     16    var description;
     17    var exception = null;
     18 
     19    test.pcLocal.close();
     20 
     21    try { description = test.pcLocal.localDescription; } catch (e) { exception = e; }
     22    ok(exception, "Attempt to access localDescription of pcLocal after close throws exception");
     23    exception = null;
     24 
     25    try { description = test.pcLocal.remoteDescription; } catch (e) { exception = e; }
     26    ok(exception, "Attempt to access remoteDescription of pcLocal after close throws exception");
     27    exception = null;
     28 
     29    test.pcRemote.close();
     30 
     31    try  { description = test.pcRemote.localDescription; } catch (e) { exception = e; }
     32    ok(exception, "Attempt to access localDescription of pcRemote after close throws exception");
     33    exception = null;
     34 
     35    try  { description = test.pcRemote.remoteDescription; } catch (e) { exception = e; }
     36    ok(exception, "Attempt to access remoteDescription of pcRemote after close throws exception");
     37  }
     38 ];
     39 
     40 var test;
     41 runNetworkTest(() => {
     42  test = new PeerConnectionTest();
     43  test.setMediaConstraints([{audio: true}], [{audio: true}]);
     44  test.chain.append(steps);
     45  return test.run();
     46 });
     47 </script>
     48 </pre>
     49 </body>
     50 </html>