test_peerConnection_remoteReofferRollback.html (1479B)
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: "952145", 11 title: "Rollback remote reoffer" 12 }); 13 14 runNetworkTest(function (options) { 15 const test = new PeerConnectionTest(options); 16 addRenegotiation(test.chain, 17 [ 18 function PC_LOCAL_ADD_SECOND_STREAM(test) { 19 test.setMediaConstraints([{audio: true}, {audio: true}], 20 [{audio: true}]); 21 return test.pcLocal.getAllUserMediaAndAddStreams([{audio: true}]); 22 }, 23 ] 24 ); 25 test.chain.replaceAfter('PC_REMOTE_SET_REMOTE_DESCRIPTION', 26 [ 27 function PC_REMOTE_ROLLBACK(test) { 28 return test.setRemoteDescription(test.pcRemote, { type: "rollback" }, 29 STABLE); 30 }, 31 32 function PC_LOCAL_ROLLBACK(test) { 33 // We haven't negotiated the new stream yet. 34 test.pcLocal.expectNegotiationNeeded(); 35 return test.setLocalDescription( 36 test.pcLocal, 37 new RTCSessionDescription({ type: "rollback", sdp: ""}), 38 STABLE); 39 }, 40 ], 41 1 // Second PC_REMOTE_SET_REMOTE_DESCRIPTION 42 ); 43 test.chain.append(commandsPeerConnectionOfferAnswer); 44 test.setMediaConstraints([{audio: true}], [{audio: true}]); 45 return test.run(); 46 }); 47 </script> 48 </pre> 49 </body> 50 </html>