| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> | 3 <script type="text/javascript" src="webrtc_test_utilities.js"></script> |
| 4 <script type="text/javascript" src="webrtc_test_audio.js"></script> | 4 <script type="text/javascript" src="webrtc_test_audio.js"></script> |
| 5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
| 6 $ = function(id) { | 6 $ = function(id) { |
| 7 return document.getElementById(id); | 7 return document.getElementById(id); |
| 8 }; | 8 }; |
| 9 | 9 |
| 10 var gFirstConnection = null; | 10 var gFirstConnection = null; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 onLocalDescriptionError = function(error) { | 163 onLocalDescriptionError = function(error) { |
| 164 var expectedMsg = 'SetLocalDescription failed: Called with a SDP without' | 164 var expectedMsg = 'SetLocalDescription failed: Called with a SDP without' |
| 165 + ' crypto enabled.'; | 165 + ' crypto enabled.'; |
| 166 expectEquals(expectedMsg, error); | 166 expectEquals(expectedMsg, error); |
| 167 | 167 |
| 168 // Got the right message, test succeeded. | 168 // Got the right message, test succeeded. |
| 169 document.title = 'OK'; | 169 document.title = 'OK'; |
| 170 }; | 170 }; |
| 171 } | 171 } |
| 172 | 172 |
| 173 // Test that we can negotiate a call with an SDP offer that includes a |
| 174 // b=AS:XX line to control audio and video bandwidth |
| 175 function negotiateOfferWithBLine() { |
| 176 createConnections(null); |
| 177 transformSdp = addBandwithControl; |
| 178 navigator.webkitGetUserMedia({audio: true, video: true}, |
| 179 addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); |
| 180 waitForVideo('remote-view-1'); |
| 181 waitForVideo('remote-view-2'); |
| 182 } |
| 183 |
| 173 // Test that we can setup call with legacy settings. | 184 // Test that we can setup call with legacy settings. |
| 174 function callWithLegacySdp() { | 185 function callWithLegacySdp() { |
| 175 transformSdp = function(sdp) { | 186 transformSdp = function(sdp) { |
| 176 return removeBundle(useGice(useExternalSdes(sdp))); | 187 return removeBundle(useGice(useExternalSdes(sdp))); |
| 177 }; | 188 }; |
| 178 transformCandidate = addGiceCredsToCandidate; | 189 transformCandidate = addGiceCredsToCandidate; |
| 179 createConnections({ | 190 createConnections({ |
| 180 'mandatory': {'RtpDataChannels': true, 'DtlsSrtpKeyAgreement': false} | 191 'mandatory': {'RtpDataChannels': true, 'DtlsSrtpKeyAgreement': false} |
| 181 }); | 192 }); |
| 182 setupDataChannel({reliable: false}); | 193 setupDataChannel({reliable: false}); |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 'a=rtpmap:100 XVP8/90000\r\n'); | 684 'a=rtpmap:100 XVP8/90000\r\n'); |
| 674 return offerSdp; | 685 return offerSdp; |
| 675 } | 686 } |
| 676 | 687 |
| 677 function removeCrypto(offerSdp) { | 688 function removeCrypto(offerSdp) { |
| 678 offerSdp = offerSdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n'); | 689 offerSdp = offerSdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n'); |
| 679 offerSdp = offerSdp.replace(/a=fingerprint.*\r\n/g, ''); | 690 offerSdp = offerSdp.replace(/a=fingerprint.*\r\n/g, ''); |
| 680 return offerSdp; | 691 return offerSdp; |
| 681 } | 692 } |
| 682 | 693 |
| 694 function addBandwithControl(offerSdp) { |
| 695 offerSdp = offerSdp.replace('a=mid:audio\r\n', 'a=mid:audio\r\n'+ |
| 696 'b=AS:16\r\n'); |
| 697 offerSdp = offerSdp.replace('a=mid:video\r\n', 'a=mid:video\r\n'+ |
| 698 'b=AS:512\r\n'); |
| 699 return offerSdp; |
| 700 } |
| 701 |
| 683 function removeBundle(sdp) { | 702 function removeBundle(sdp) { |
| 684 return sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); | 703 return sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); |
| 685 } | 704 } |
| 686 | 705 |
| 687 function useGice(sdp) { | 706 function useGice(sdp) { |
| 688 sdp = sdp.replace(/t=.*\r\n/g, function(subString) { | 707 sdp = sdp.replace(/t=.*\r\n/g, function(subString) { |
| 689 return subString + 'a=ice-options:google-ice\r\n'; | 708 return subString + 'a=ice-options:google-ice\r\n'; |
| 690 }); | 709 }); |
| 691 sdp = sdp.replace(/a=ice-ufrag:.*\r\n/g, | 710 sdp = sdp.replace(/a=ice-ufrag:.*\r\n/g, |
| 692 'a=ice-ufrag:' + EXTERNAL_GICE_UFRAG + '\r\n'); | 711 'a=ice-ufrag:' + EXTERNAL_GICE_UFRAG + '\r\n'); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 <td><canvas width="320" height="240" id="remote-view-2-canvas" | 798 <td><canvas width="320" height="240" id="remote-view-2-canvas" |
| 780 style="display:none"></canvas></td> | 799 style="display:none"></canvas></td> |
| 781 <td><canvas width="320" height="240" id="remote-view-3-canvas" | 800 <td><canvas width="320" height="240" id="remote-view-3-canvas" |
| 782 style="display:none"></canvas></td> | 801 style="display:none"></canvas></td> |
| 783 <td><canvas width="320" height="240" id="remote-view-4-canvas" | 802 <td><canvas width="320" height="240" id="remote-view-4-canvas" |
| 784 style="display:none"></canvas></td> | 803 style="display:none"></canvas></td> |
| 785 </tr> | 804 </tr> |
| 786 </table> | 805 </table> |
| 787 </body> | 806 </body> |
| 788 </html> | 807 </html> |
| OLD | NEW |