test_peerConnection_basicAudioVideoVerifyTooLongMidFails.html (1538B)
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: "1427009", 11 title: "Test mid longer than 16 characters fails" 12 }); 13 14 var test; 15 runNetworkTest(function (options) { 16 options = options || { }; 17 options.bundle = false; 18 test = new PeerConnectionTest(options); 19 test.setMediaConstraints([{audio: true}, {video: true}], 20 [{audio: true}, {video: true}]); 21 22 test.chain.replaceAfter("PC_LOCAL_CREATE_OFFER", 23 [ 24 function PC_LOCAL_MUNGE_OFFER_SDP(test) { 25 test.originalOffer.sdp = 26 test.originalOffer.sdp.replace(/a=mid:.*\r\n/g, 27 "a=mid:really_long_mid_over_16_chars\r\n"); 28 }, 29 function PC_LOCAL_EXPECT_SET_LOCAL_DESCRIPTION_FAIL(test) { 30 return test.setLocalDescription(test.pcLocal, 31 test.originalOffer, 32 HAVE_LOCAL_OFFER) 33 .then(() => ok(false, "setLocalDescription must fail"), 34 // This needs to be RTCError once we support it, and once we 35 // stop allowing any modification, InvalidModificationError 36 e => is(e.name, "OperationError", 37 "setLocalDescription must fail and did")); 38 } 39 ], 0 // first occurance 40 ); 41 42 return test.run(); 43 }); 44 </script> 45 </pre> 46 </body> 47 </html>