test_peerConnection_setRemoteAnswerInHaveRemoteOffer.html (906B)
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 'have-remote-offer'" 12 }); 13 14 runNetworkTest(function () { 15 const test = new PeerConnectionTest(); 16 test.setMediaConstraints([{audio: true}], [{audio: true}]); 17 test.chain.removeAfter("PC_REMOTE_SET_REMOTE_DESCRIPTION"); 18 19 test.chain.append([ 20 function PC_REMOTE_SET_REMOTE_ANSWER(test) { 21 test.pcLocal._latest_offer.type = "answer"; 22 test.pcRemote._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>