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..758e57c40bf68614d0ac47c5dda15b9c2b15a1ce 100644 |
--- a/content/test/data/media/peerconnection-call.html |
+++ b/content/test/data/media/peerconnection-call.html |
@@ -12,11 +12,12 @@ |
var gTestWithoutMsid = false; |
var gLocalStream = null; |
var gSentTones = ''; |
+ var gForceIsac16K = false; |
var gRemoteStreams = {}; |
// Default transform functions, overridden by some test cases. |
- var transformSdp = function(sdp) { return sdp; }; |
+ var transformSdp = function(sdp) { return gForceIsac16K ? forceIsac16k_(sdp) : sdp; }; |
var transformRemoteSdp = function(sdp) { return sdp; }; |
var transformCandidate = function(candidate) { return candidate; }; |
var onLocalDescriptionError = function(error) { }; |
@@ -35,10 +36,25 @@ |
var EXTERNAL_GICE_UFRAG = '1234567890123456'; |
var EXTERNAL_GICE_PWD = '123456789012345678901234'; |
+ /** @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; |
+ } |
+ |
setAllEventsOccuredHandler(function() { |
document.title = 'OK'; |
}); |
+ // Set gForceIsac16K. |
+ function setForceIsac16K(force_isac_16k) { |
+ gForceIsac16K = force_isac_16k; |
+ } |
+ |
// Test that we can setup call with an audio and video track. |
function call(constraints) { |
createConnections(null); |
@@ -248,20 +264,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); |
@@ -279,8 +282,8 @@ |
detectVideoPlaying('remote-view-2', onCallEstablished); |
} |
- function callAndEnsureAudioMutingWorks(force_isac_16k) { |
- callAndEnsureAudioIsPlaying(force_isac_16k); |
+ function callAndEnsureAudioMutingWorks() { |
+ callAndEnsureAudioIsPlaying(); |
setAllEventsOccuredHandler(function() { |
var audioTrack = |
gSecondConnection.getRemoteStreams()[0].getAudioTracks()[0]; |
@@ -634,17 +637,18 @@ |
function removeVideoCodec(offerSdp) { |
offerSdp = offerSdp.replace('a=rtpmap:100 VP8/90000\r\n', |
'a=rtpmap:100 XVP8/90000\r\n'); |
- return offerSdp; |
+ return gForceIsac16K ? forceIsac16k_(offerSdp) : offerSdp; |
} |
function removeCrypto(offerSdp) { |
offerSdp = offerSdp.replace(/a=crypto.*\r\n/g, 'a=Xcrypto\r\n'); |
offerSdp = offerSdp.replace(/a=fingerprint.*\r\n/g, ''); |
- return offerSdp; |
+ return gForceIsac16K ? forceIsac16k_(offerSdp) : offerSdp; |
} |
function removeBundle(sdp) { |
- return sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); |
+ sdp = sdp.replace(/a=group:BUNDLE .*\r\n/g, ''); |
+ return gForceIsac16K ? forceIsac16k_(sdp) : sdp; |
} |
function useGice(sdp) { |