Commit 3e0e0087 authored by xians@chromium.org's avatar xians@chromium.org

Add browser test to connect chormium sink to remote tracks, verify that no crash.


BUG=396447

Review URL: https://codereview.chromium.org/417203002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285808 0039d316-1c4b-4281-b951-d872f2087c98
parent 52aff254
...@@ -208,6 +208,11 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream720p) { ...@@ -208,6 +208,11 @@ IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, MAYBE_CanForwardRemoteStream720p) {
MakeTypicalPeerConnectionCall(javascript); MakeTypicalPeerConnectionCall(javascript);
} }
IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest,
NoCrashWhenConnectChromiumSinkToRemoteTrack) {
MakeTypicalPeerConnectionCall("ConnectChromiumSinkToRemoteAudioTrack();");
}
// This test will make a complete PeerConnection-based call but remove the // This test will make a complete PeerConnection-based call but remove the
// MSID and bundle attribute from the initial offer to verify that // 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 // video is playing for the call even if the initiating client don't support
......
...@@ -136,6 +136,30 @@ ...@@ -136,6 +136,30 @@
detectVideoPlaying('remote-view-2', onRemoteStream2); detectVideoPlaying('remote-view-2', onRemoteStream2);
} }
// First makes a call between pc1 and pc2, and then construct a new media
// stream using the remote audio and video tracks, connect the new media
// stream to a video element. These operations should not crash Chrome.
function ConnectChromiumSinkToRemoteAudioTrack() {
createConnections(null);
navigator.webkitGetUserMedia({audio: true, video: true},
addStreamToBothConnectionsAndNegotiate,
printGetUserMediaError);
detectVideoPlaying('remote-view-2', function() {
// Construct a new media stream with remote tracks.
var newStream = new webkitMediaStream();
newStream.addTrack(
gSecondConnection.getRemoteStreams()[0].getAudioTracks()[0]);
newStream.addTrack(
gSecondConnection.getRemoteStreams()[0].getVideoTracks()[0]);
var videoElement = document.createElement('video');
// No crash for this operation.
videoElement.src = URL.createObjectURL(newStream);
waitForVideo('remote-view-2');
});
}
// Test that we can setup call with an audio and video track and // Test that we can setup call with an audio and video track and
// simulate that the remote peer don't support MSID. // simulate that the remote peer don't support MSID.
function callWithoutMsidAndBundle() { function callWithoutMsidAndBundle() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment