test_peerConnection_setRemoteOfferInHaveLocalOffer.html (1082B)
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 (offer) in 'have-local-offer'" 12 }); 13 14 runNetworkTest(function () { 15 const test = new PeerConnectionTest(); 16 test.setMediaConstraints([{audio: true}], [{audio: true}]); 17 test.chain.removeAfter("PC_LOCAL_SET_LOCAL_DESCRIPTION"); 18 19 test.chain.append([ 20 async function PC_LOCAL_SET_REMOTE_OFFER(test) { 21 const p = test.pcLocal._pc.setRemoteDescription(test.pcLocal._latest_offer); 22 await new Promise(r => test.pcLocal.onsignalingstatechange = r); 23 is(test.pcLocal._pc.signalingState, 'stable', 'should fire stable'); 24 await new Promise(r => test.pcLocal.onsignalingstatechange = r); 25 is(test.pcLocal._pc.signalingState, 'have-remote-offer', 26 'should fire have-remote-offer'); 27 await p; 28 ok(true, 'setRemoteDescription should succeed'); 29 } 30 ]); 31 32 return test.run(); 33 }); 34 </script> 35 </pre> 36 </body> 37 </html>