test_peerConnection_localRollback.html (1473B)
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 offer" 12 }); 13 14 runNetworkTest(function (options) { 15 const test = new PeerConnectionTest(options); 16 test.setMediaConstraints([{audio: true}], [{audio: true}]); 17 test.chain.insertBefore('PC_LOCAL_CREATE_OFFER', [ 18 function PC_REMOTE_CREATE_AND_SET_OFFER(test) { 19 return test.createOffer(test.pcRemote).then(offer => { 20 return test.setLocalDescription(test.pcRemote, offer, HAVE_LOCAL_OFFER); 21 }); 22 }, 23 24 function PC_REMOTE_ROLLBACK(test) { 25 // the negotiationNeeded slot should have been true both before and 26 // after this SLD, so the event should fire again. 27 test.pcRemote.expectNegotiationNeeded(); 28 return test.setLocalDescription(test.pcRemote, 29 { type: "rollback", sdp: "" }, 30 STABLE); 31 }, 32 33 // Rolling back should shut down gathering 34 function PC_REMOTE_WAIT_FOR_END_OF_TRICKLE(test) { 35 is(test.pcRemote._pc.iceGatheringState, "new"); 36 }, 37 38 function PC_REMOTE_SETUP_ICE_HANDLER(test) { 39 test.pcRemote.setupIceCandidateHandler(test); 40 }, 41 ]); 42 return test.run(); 43 }); 44 </script> 45 </pre> 46 </body> 47 </html>