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(force_isac_16k) { | |
| 158 if (force_isac_16k) | |
| 159 transformSdp = forceIsac16k_; | |
| 160 createConnections(null); | |
| 161 transformSdp = addBandwithControl; | |
|
wjia(left Chromium)
2013/12/13 18:24:19
Shall you call forceIsac16k_ inside addBandwithCon
| |
| 162 navigator.webkitGetUserMedia({audio: true, video: true}, | |
| 163 addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); | |
| 164 waitForVideo('remote-view-1'); | |
| 165 waitForVideo('remote-view-2'); | |
| 166 } | |
| 167 | |
| 155 // Test that we can setup call with legacy settings. | 168 // Test that we can setup call with legacy settings. |
| 156 function callWithLegacySdp() { | 169 function callWithLegacySdp() { |
| 157 transformSdp = function(sdp) { | 170 transformSdp = function(sdp) { |
| 158 return removeBundle(useGice(useExternalSdes(sdp))); | 171 return removeBundle(useGice(useExternalSdes(sdp))); |
| 159 }; | 172 }; |
| 160 transformCandidate = addGiceCredsToCandidate; | 173 transformCandidate = addGiceCredsToCandidate; |
| 161 createConnections({ | 174 createConnections({ |
| 162 'mandatory': {'RtpDataChannels': true, 'DtlsSrtpKeyAgreement': false} | 175 'mandatory': {'RtpDataChannels': true, 'DtlsSrtpKeyAgreement': false} |
| 163 }); | 176 }); |
| 164 setupDataChannel({reliable: false}); | 177 setupDataChannel({reliable: false}); |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 'a=rtpmap:100 XVP8/90000\r\n'); | 649 'a=rtpmap:100 XVP8/90000\r\n'); |
| 637 return offerSdp; | 650 return offerSdp; |
| 638 } | 651 } |
| 639 | 652 |
| 640 function removeCrypto(offerSdp) { | 653 function removeCrypto(offerSdp) { |
| 641 offerSdp = offerSdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n'); | 654 offerSdp = offerSdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n'); |
| 642 offerSdp = offerSdp.replace(/a=fingerprint.*\r\n/g, ''); | 655 offerSdp = offerSdp.replace(/a=fingerprint.*\r\n/g, ''); |
| 643 return offerSdp; | 656 return offerSdp; |
| 644 } | 657 } |
| 645 | 658 |
| 659 function addBandwithControl(offerSdp) { | |
| 660 offerSdp = offerSdp.replace('a=mid:audio\r\n', 'a=mid:audio\r\n'+ | |
| 661 'b=AS:16\r\n'); | |
| 662 offerSdp = offerSdp.replace('a=mid:video\r\n', 'a=mid:video\r\n'+ | |
| 663 'b=AS:512\r\n'); | |
| 664 return offerSdp; | |
| 665 } | |
| 666 | |
| 646 function removeBundle(sdp) { | 667 function removeBundle(sdp) { |
| 647 return sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); | 668 return sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); |
| 648 } | 669 } |
| 649 | 670 |
| 650 function useGice(sdp) { | 671 function useGice(sdp) { |
| 651 sdp = sdp.replace(/t=.*\r\n/g, function(subString) { | 672 sdp = sdp.replace(/t=.*\r\n/g, function(subString) { |
| 652 return subString + 'a=ice-options:google-ice\r\n'; | 673 return subString + 'a=ice-options:google-ice\r\n'; |
| 653 }); | 674 }); |
| 654 sdp = sdp.replace(/a=ice-ufrag:.*\r\n/g, | 675 sdp = sdp.replace(/a=ice-ufrag:.*\r\n/g, |
| 655 'a=ice-ufrag:' + EXTERNAL_GICE_UFRAG + '\r\n'); | 676 '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" | 763 <td><canvas width="320" height="240" id="remote-view-2-canvas" |
| 743 style="display:none"></canvas></td> | 764 style="display:none"></canvas></td> |
| 744 <td><canvas width="320" height="240" id="remote-view-3-canvas" | 765 <td><canvas width="320" height="240" id="remote-view-3-canvas" |
| 745 style="display:none"></canvas></td> | 766 style="display:none"></canvas></td> |
| 746 <td><canvas width="320" height="240" id="remote-view-4-canvas" | 767 <td><canvas width="320" height="240" id="remote-view-4-canvas" |
| 747 style="display:none"></canvas></td> | 768 style="display:none"></canvas></td> |
| 748 </tr> | 769 </tr> |
| 749 </table> | 770 </table> |
| 750 </body> | 771 </body> |
| 751 </html> | 772 </html> |
| OLD | NEW |