Chromium Code Reviews| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 onLocalDescriptionError = function(error) { | 145 onLocalDescriptionError = function(error) { |
| 146 var expectedMsg = 'SetLocalDescription failed: Called with a SDP without' | 146 var expectedMsg = 'SetLocalDescription failed: Called with a SDP without' |
| 147 + ' crypto enabled.'; | 147 + ' crypto enabled.'; |
| 148 expectEquals(expectedMsg, error); | 148 expectEquals(expectedMsg, error); |
| 149 | 149 |
| 150 // Got the right message, test succeeded. | 150 // Got the right message, test succeeded. |
| 151 document.title = 'OK'; | 151 document.title = 'OK'; |
| 152 }; | 152 }; |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Test that we can negotiate a call with an SDP offer that includes a | |
| 156 // b=AS:XX line to control audio and video bandwidth | |
| 157 function negotiateOfferWithBLine() { | |
| 158 createConnections(null); | |
| 159 transformSdp = addBandwithControl; | |
| 160 navigator.webkitGetUserMedia({audio: true, video: true}, | |
| 161 addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); | |
| 162 waitForVideo('remote-view-1'); | |
| 163 waitForVideo('remote-view-2'); | |
| 164 } | |
| 165 | |
| 155 // Test that we can setup call with legacy settings. | 166 // Test that we can setup call with legacy settings. |
| 156 function callWithLegacySdp() { | 167 function callWithLegacySdp() { |
| 157 transformSdp = function(sdp) { | 168 transformSdp = function(sdp) { |
| 158 return removeBundle(useGice(useExternalSdes(sdp))); | 169 return removeBundle(useGice(useExternalSdes(sdp))); |
| 159 }; | 170 }; |
| 160 transformCandidate = addGiceCredsToCandidate; | 171 transformCandidate = addGiceCredsToCandidate; |
| 161 createConnections({ | 172 createConnections({ |
| 162 'mandatory': {'RtpDataChannels': true, 'DtlsSrtpKeyAgreement': false} | 173 'mandatory': {'RtpDataChannels': true, 'DtlsSrtpKeyAgreement': false} |
| 163 }); | 174 }); |
| 164 setupDataChannel({reliable: false}); | 175 setupDataChannel({reliable: false}); |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 'a=rtpmap:100 XVP8/90000\r\n'); | 647 'a=rtpmap:100 XVP8/90000\r\n'); |
| 637 return offerSdp; | 648 return offerSdp; |
| 638 } | 649 } |
| 639 | 650 |
| 640 function removeCrypto(offerSdp) { | 651 function removeCrypto(offerSdp) { |
| 641 offerSdp = offerSdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n'); | 652 offerSdp = offerSdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n'); |
| 642 offerSdp = offerSdp.replace(/a=fingerprint.*\r\n/g, ''); | 653 offerSdp = offerSdp.replace(/a=fingerprint.*\r\n/g, ''); |
| 643 return offerSdp; | 654 return offerSdp; |
| 644 } | 655 } |
| 645 | 656 |
| 657 function addBandwithControl(offerSdp) { | |
| 658 offerSdp = offerSdp.replace('a=mid:audio\r\n', 'a=mid:audio\r\n'+'b=AS:16\r\ n'); | |
|
phoglund_chromium
2013/12/12 10:02:32
Nit: line is too long.
| |
| 659 offerSdp = offerSdp.replace('a=mid:video\r\n', 'a=mid:video\r\n'+'b=AS:512\r \n'); | |
| 660 return offerSdp; | |
| 661 } | |
| 662 | |
| 646 function removeBundle(sdp) { | 663 function removeBundle(sdp) { |
| 647 return sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); | 664 return sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); |
| 648 } | 665 } |
| 649 | 666 |
| 650 function useGice(sdp) { | 667 function useGice(sdp) { |
| 651 sdp = sdp.replace(/t=.*\r\n/g, function(subString) { | 668 sdp = sdp.replace(/t=.*\r\n/g, function(subString) { |
| 652 return subString + 'a=ice-options:google-ice\r\n'; | 669 return subString + 'a=ice-options:google-ice\r\n'; |
| 653 }); | 670 }); |
| 654 sdp = sdp.replace(/a=ice-ufrag:.*\r\n/g, | 671 sdp = sdp.replace(/a=ice-ufrag:.*\r\n/g, |
| 655 'a=ice-ufrag:' + EXTERNAL_GICE_UFRAG + '\r\n'); | 672 'a=ice-ufrag:' + EXTERNAL_GICE_UFRAG + '\r\n'); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 742 <td><canvas width="320" height="240" id="remote-view-2-canvas" | 759 <td><canvas width="320" height="240" id="remote-view-2-canvas" |
| 743 style="display:none"></canvas></td> | 760 style="display:none"></canvas></td> |
| 744 <td><canvas width="320" height="240" id="remote-view-3-canvas" | 761 <td><canvas width="320" height="240" id="remote-view-3-canvas" |
| 745 style="display:none"></canvas></td> | 762 style="display:none"></canvas></td> |
| 746 <td><canvas width="320" height="240" id="remote-view-4-canvas" | 763 <td><canvas width="320" height="240" id="remote-view-4-canvas" |
| 747 style="display:none"></canvas></td> | 764 style="display:none"></canvas></td> |
| 748 </tr> | 765 </tr> |
| 749 </table> | 766 </table> |
| 750 </body> | 767 </body> |
| 751 </html> | 768 </html> |
| OLD | NEW |