Index: content/test/data/media/peerconnection-call.html |
diff --git a/content/test/data/media/peerconnection-call.html b/content/test/data/media/peerconnection-call.html |
index afd8b0318795ca2a962104034c842b913431fccf..20129ad26cfc85edd6fb120c941ea32e7ba88b71 100644 |
--- a/content/test/data/media/peerconnection-call.html |
+++ b/content/test/data/media/peerconnection-call.html |
@@ -21,6 +21,22 @@ |
var transformCandidate = function(candidate) { return candidate; }; |
var onLocalDescriptionError = function(error) { }; |
+ // Temporary measure to be able to force iSAC 16K where needed, particularly |
+ // on Android. This applies to every test which is why it's implemented like |
+ // this. |
+ var maybeForceIsac16K = function(sdp) { return sdp; }; |
+ function forceIsac16KInSdp() { |
+ maybeForceIsac16K = function(sdp) { |
+ // Remove all other codecs (not the video codecs though). |
+ sdp = sdp.replace(/m=audio (\d+) RTP\/SAVPF.*\r\n/g, |
+ 'm=audio $1 RTP/SAVPF 103\r\n'); |
+ sdp = sdp.replace('a=fmtp:111 minptime=10', 'a=fmtp:103 minptime=10'); |
+ sdp = sdp.replace(/a=rtpmap:(?!103)\d{1,3} (?!VP8|red|ulpfec).*\r\n/g, |
+ ''); |
+ return sdp; |
+ }; |
+ } |
+ |
// When using external SDES, the crypto key is chosen by javascript. |
var EXTERNAL_SDES_LINES = { |
'audio': 'a=crypto:1 AES_CM_128_HMAC_SHA1_80 ' + |
@@ -36,6 +52,7 @@ |
var EXTERNAL_GICE_PWD = '123456789012345678901234'; |
setAllEventsOccuredHandler(function() { |
+ // The C++ tests look for this 'OK' in the title. |
document.title = 'OK'; |
}); |
@@ -248,20 +265,7 @@ |
detectVideoPlaying('remote-view-2', onCallEstablished); |
} |
- //TODO(phoglund): do this for all tests on android if this works on bots. |
- /** @private */ |
- function forceIsac16k_(sdp) { |
- // Remove all other codecs (not the video codecs though). |
- sdp = sdp.replace(/m=audio (\d+) RTP\/SAVPF.*\r\n/g, |
- 'm=audio $1 RTP/SAVPF 103\r\n'); |
- sdp = sdp.replace('a=fmtp:111 minptime=10', 'a=fmtp:103 minptime=10'); |
- sdp = sdp.replace(/a=rtpmap:(?!103)\d{1,3} (?!VP8|red|ulpfec).*\r\n/g, ''); |
- return sdp; |
- } |
- |
- function callAndEnsureAudioIsPlaying(force_isac_16k) { |
- if (force_isac_16k) |
- transformSdp = forceIsac16k_; |
+ function callAndEnsureAudioIsPlaying() { |
createConnections(null); |
navigator.webkitGetUserMedia({audio: true, video: true}, |
addStreamToBothConnectionsAndNegotiate, printGetUserMediaError); |
@@ -368,7 +372,7 @@ |
local_stream.addTrack(gLocalStream.getAudioTracks()[0]); |
local_stream.removeTrack(local_stream.getVideoTracks()[0]); |
negotiate(); |
- }); // End of setAllEventsOccuredHandler. |
+ }); |
} |
// This function is used for setting up a test that: |
@@ -604,7 +608,7 @@ |
} |
function onOfferCreated(offer, caller, callee) { |
- offer.sdp = transformSdp(offer.sdp); |
+ offer.sdp = maybeForceIsac16K(transformSdp(offer.sdp)); |
caller.setLocalDescription(offer, function() { |
expectEquals('have-local-offer', caller.signalingState); |
receiveOffer(offer.sdp, caller, callee); |
@@ -670,7 +674,7 @@ |
} |
function onAnswerCreated(answer, caller, callee) { |
- answer.sdp = transformSdp(answer.sdp); |
+ answer.sdp = maybeForceIsac16K(transformSdp(answer.sdp)); |
callee.setLocalDescription(answer); |
expectEquals('stable', callee.signalingState); |
receiveAnswer(answer.sdp, caller); |