summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorperkj@chromium.org <perkj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-20 12:30:35 +0000
committerperkj@chromium.org <perkj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-20 12:30:35 +0000
commit933b7483adef1676e75b88183d0d8768063fe839 (patch)
treeaf2670f34fea7cecce196a2c2b47508c9c10fdf1
parent8908ec69ac4a3515803ebf0127eb4826d49aa7b8 (diff)
downloadchromium_src-933b7483adef1676e75b88183d0d8768063fe839.zip
chromium_src-933b7483adef1676e75b88183d0d8768063fe839.tar.gz
chromium_src-933b7483adef1676e75b88183d0d8768063fe839.tar.bz2
Add WebRtc content browsertest for case where a client dont support MSID.
http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02. http://code.google.com/p/webrtc/issues/detail?id=932 Review URL: https://chromiumcodereview.appspot.com/11593027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174146 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/webrtc_browsertest.cc13
-rw-r--r--content/test/data/media/peerconnection-call.html25
2 files changed, 38 insertions, 0 deletions
diff --git a/content/browser/webrtc_browsertest.cc b/content/browser/webrtc_browsertest.cc
index 867ff04..98b9c8c 100644
--- a/content/browser/webrtc_browsertest.cc
+++ b/content/browser/webrtc_browsertest.cc
@@ -82,5 +82,18 @@ IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest, CanSetupAudioAndVideoCall) {
ExpectTitle("OK");
}
+// This test will make a complete PeerConnection-based call but remove the
+// MSID and bundle attribute from the initial offer to verify that
+// video is playing for the call even if the initiating client don't support
+// MSID. http://tools.ietf.org/html/draft-alvestrand-rtcweb-msid-02
+IN_PROC_BROWSER_TEST_F(WebrtcBrowserTest,
+ CanSetupAudioAndVideoCallWithoutMsidAndBundle) {
+ GURL url(test_server()->GetURL("files/media/peerconnection-call.html"));
+ NavigateToURL(shell(), url);
+
+ EXPECT_TRUE(ExecuteJavascript("callWithoutMsidAndBundle();"));
+ ExpectTitle("OK");
+}
+
} // namespace content
diff --git a/content/test/data/media/peerconnection-call.html b/content/test/data/media/peerconnection-call.html
index cade13d..be3387b 100644
--- a/content/test/data/media/peerconnection-call.html
+++ b/content/test/data/media/peerconnection-call.html
@@ -7,10 +7,17 @@
var gFirstConnection = null;
var gSecondConnection = null;
+ var gTestWithoutMsidAndBundle = false;
function call(constraints) {
navigator.webkitGetUserMedia(constraints, okCallback, failedCallback);
}
+
+ function callWithoutMsidAndBundle() {
+ gTestWithoutMsidAndBundle = true;
+ navigator.webkitGetUserMedia({audio:true, video:true}, okCallback,
+ failedCallback);
+ }
function failedCallback(error) {
document.title = 'getUserMedia request failed with code ' + error.code;
@@ -37,6 +44,9 @@
}
function receiveCall(offerSdp) {
+ if (gTestWithoutMsidAndBundle) {
+ offerSdp = removeMsidAndBundle(offerSdp);
+ }
gSecondConnection = new webkitRTCPeerConnection(null, null);
gSecondConnection.onicecandidate = onIceCandidateToSecond;
gSecondConnection.onaddstream = onRemoteStream;
@@ -47,6 +57,15 @@
gSecondConnection.createAnswer(onAnswerCreated);
}
+
+ function removeMsidAndBundle(offerSdp) {
+ offerSdp = offerSdp.replace(/a=msid-semantics.*\r\n/g, '');
+ offerSdp = offerSdp.replace('a=group:BUNDLE audio video\r\n', '');
+ offerSdp = offerSdp.replace('a=mid:audio\r\n', '');
+ offerSdp = offerSdp.replace('a=mid:video\r\n', '');
+ offerSdp = offerSdp.replace(/a=ssrc.*\r\n/g, '');
+ return offerSdp;
+ }
function onAnswerCreated(answer) {
gSecondConnection.setLocalDescription(answer);
@@ -77,6 +96,12 @@
var remoteStreamUrl = webkitURL.createObjectURL(e.stream);
var remoteVideo = $('remote-view');
remoteVideo.src = remoteStreamUrl;
+
+ if (gTestWithoutMsidAndBundle && e.stream.label != "default") {
+ document.title = 'a default remote stream was expected but instead ' +
+ e.stream.label + ' was received.';
+ return;
+ }
waitForVideo(remoteVideo, 320, 240);
}