test_peerConnection_localReofferRollback.html (1409B)
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 local reoffer" 12 }); 13 14 runNetworkTest(function (options) { 15 const test = new PeerConnectionTest(options); 16 addRenegotiation(test.chain, [ 17 function PC_LOCAL_ADD_SECOND_STREAM(test) { 18 test.setMediaConstraints([{audio: true}, {audio: true}], 19 [{audio: true}]); 20 return test.pcLocal.getAllUserMediaAndAddStreams([{audio: true}]); 21 }, 22 23 function PC_LOCAL_CREATE_AND_SET_OFFER(test) { 24 return test.createOffer(test.pcLocal).then(offer => { 25 return test.setLocalDescription(test.pcLocal, offer, HAVE_LOCAL_OFFER); 26 }); 27 }, 28 29 function PC_LOCAL_ROLLBACK(test) { 30 // the negotiationNeeded slot should have been true both before and 31 // after this SLD, so the event should fire again. 32 test.pcLocal.expectNegotiationNeeded(); 33 return test.setLocalDescription(test.pcLocal, 34 { type: "rollback", sdp: "" }, 35 STABLE); 36 }, 37 ]); 38 test.setMediaConstraints([{audio: true}], [{audio: true}]); 39 return test.run(); 40 }); 41 </script> 42 </pre> 43 </body> 44 </html>