test_peerConnection_remoteRollback.html (1543B)
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 offer" 12 }); 13 14 runNetworkTest(function (options) { 15 const test = new PeerConnectionTest(options); 16 test.setMediaConstraints([{audio: true}], [{audio: true}]); 17 test.chain.removeAfter('PC_REMOTE_CHECK_CAN_TRICKLE_SYNC'); 18 test.chain.append([ 19 function PC_REMOTE_ROLLBACK(test) { 20 // We still haven't negotiated the tracks 21 test.pcRemote.expectNegotiationNeeded(); 22 return test.setRemoteDescription(test.pcRemote, { type: "rollback" }, 23 STABLE); 24 }, 25 26 function PC_REMOTE_CHECK_CAN_TRICKLE_REVERT_SYNC(test) { 27 is(test.pcRemote._pc.canTrickleIceCandidates, null, 28 "Remote canTrickleIceCandidates is reverted to null"); 29 }, 30 31 function PC_LOCAL_ROLLBACK(test) { 32 // We still haven't negotiated the tracks 33 test.pcLocal.expectNegotiationNeeded(); 34 return test.setLocalDescription( 35 test.pcLocal, 36 new RTCSessionDescription({ type: "rollback", sdp: ""}), 37 STABLE); 38 }, 39 40 // Rolling back should shut down gathering 41 function PC_LOCAL_WAIT_FOR_END_OF_TRICKLE(test) { 42 return test.pcLocal.endOfTrickleIce; 43 }, 44 ]); 45 test.chain.append(commandsPeerConnectionOfferAnswer); 46 return test.run(); 47 }); 48 </script> 49 </pre> 50 </body> 51 </html>