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

Unified Diff: chrome/test/data/webrtc/munge_sdp.js

Issue 2951713002: RTCPeerConnection.addTrack and removeTrack added (behind flag) (Closed)
Patch Set: Addressed deadbeef's comments Created 3 years, 5 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 | « chrome/browser/media/webrtc/webrtc_rtp_browsertest.cc ('k') | chrome/test/data/webrtc/peerconnection.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/munge_sdp.js
diff --git a/chrome/test/data/webrtc/munge_sdp.js b/chrome/test/data/webrtc/munge_sdp.js
index c2c7d9b6e86af648cc7a8bb16b42a4db3016e87f..70ed1e621888b3d09dcc86100466d3639f7cfa34 100644
--- a/chrome/test/data/webrtc/munge_sdp.js
+++ b/chrome/test/data/webrtc/munge_sdp.js
@@ -29,7 +29,7 @@ function setOpusDtxEnabled(sdp) {
var defaultCodec = getSdpDefaultAudioCodec(sdp);
if (defaultCodec !== 'opus') {
failure('setOpusDtxEnabled',
- 'Default audio codec is not set to \'opus\'.');
+ 'Default audio codec is not set to \'opus\'.');
}
// Find codec ID for Opus, e.g. 111 if 'a=rtpmap:111 opus/48000/2'.
@@ -64,14 +64,15 @@ function setSdpDefaultCodec(sdp, type, codec) {
// Find codec ID, e.g. 100 for 'VP8' if 'a=rtpmap:100 VP8/9000'.
var codecId = findRtpmapId(sdpLines, codec);
if (codecId === null) {
- failure('sdpPreferCodec', 'Unknown ID for |codec| = \'' + codec + '\'.');
+ failure('setSdpDefaultCodec',
+ 'Unknown ID for |codec| = \'' + codec + '\'.');
}
// Find 'm=|type|' line, e.g. 'm=video 9 UDP/TLS/RTP/SAVPF 100 101 107 116'.
var mLineNo = findLine(sdpLines, 'm=' + type);
if (mLineNo === null) {
failure('setSdpDefaultCodec',
- '\'m=' + type + '\' line missing from |sdp|.');
+ '\'m=' + type + '\' line missing from |sdp|.');
}
// Modify video line to use the desired codec as the default.
@@ -106,21 +107,21 @@ function getSdpDefaultCodec(sdp, type) {
var mLineNo = findLine(sdpLines, 'm=' + type);
if (mLineNo === null) {
failure('getSdpDefaultCodec',
- '\'m=' + type + '\' line missing from |sdp|.');
+ '\'m=' + type + '\' line missing from |sdp|.');
}
// The default codec's ID.
var defaultCodecId = getMLineDefaultCodec(sdpLines[mLineNo]);
if (defaultCodecId === null) {
failure('getSdpDefaultCodec',
- '\'m=' + type + '\' line contains no codecs.');
+ '\'m=' + type + '\' line contains no codecs.');
}
// Find codec name, e.g. 'VP8' for 100 if 'a=rtpmap:100 VP8/9000'.
var defaultCodec = findRtpmapCodec(sdpLines, defaultCodecId);
if (defaultCodec === null) {
failure('getSdpDefaultCodec',
- 'Unknown codec name for default codec ' + defaultCodecId + '.');
+ 'Unknown codec name for default codec ' + defaultCodecId + '.');
}
return defaultCodec;
}
@@ -244,9 +245,9 @@ function mergeSdpLines(sdpLines) {
}
/** @private */
-function findLine(lines, startsWith) {
- for (var i = 0; i < lines.length; i++) {
- if (lines[i].startsWith(startsWith))
+function findLine(lines, lineStartsWith, startingLine = 0) {
+ for (var i = startingLine; i < lines.length; i++) {
+ if (lines[i].startsWith(lineStartsWith))
return i;
}
return null;
« no previous file with comments | « chrome/browser/media/webrtc/webrtc_rtp_browsertest.cc ('k') | chrome/test/data/webrtc/peerconnection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698