Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(551)

Unified Diff: content/test/data/media/peerconnection-call.html

Issue 118163002: All WebRTC content browsertests will now force iSAC 16K on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/webrtc_browsertest.cc ('k') | content/test/data/media/webrtc_test_audio.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « content/browser/media/webrtc_browsertest.cc ('k') | content/test/data/media/webrtc_test_audio.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698