Commit a60a62ef authored by phoglund's avatar phoglund Committed by Commit bot

Fixing misnamed variables, re-enabling CallAndModifyStream test.

BUG=398061
R=perkj@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#318741}
parent c351e82b
...@@ -371,9 +371,7 @@ IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, ...@@ -371,9 +371,7 @@ IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest,
// MediaStream that has been created based on a MediaStream created with // MediaStream that has been created based on a MediaStream created with
// getUserMedia. When video is flowing, the VideoTrack is removed and an // getUserMedia. When video is flowing, the VideoTrack is removed and an
// AudioTrack is added instead. // AudioTrack is added instead.
// TODO(phoglund): This test is manual since not all buildbots has an audio IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, CallAndModifyStream) {
// input.
IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcBrowserTest, MANUAL_CallAndModifyStream) {
MakeTypicalPeerConnectionCall( MakeTypicalPeerConnectionCall(
"callWithNewVideoMediaStreamLaterSwitchToAudio();"); "callWithNewVideoMediaStreamLaterSwitchToAudio();");
} }
......
...@@ -533,48 +533,48 @@ ...@@ -533,48 +533,48 @@
setAllEventsOccuredHandler(function() { setAllEventsOccuredHandler(function() {
// Add an audio track to the local stream and remove the video track and // Add an audio track to the local stream and remove the video track and
// then renegotiate. But first - setup the expectations. // then renegotiate. But first - setup the expectations.
local_stream = gFirstConnection.getLocalStreams()[0]; var localStream = gFirstConnection.getLocalStreams()[0];
var remoteStream1 = gFirstConnection.getRemoteStreams()[0];
remote_stream_1 = gFirstConnection.getRemoteStreams()[0];
// Add an expected event that onaddtrack will be called on the remote // Add an expected event that onaddtrack will be called on the remote
// mediastream received on gFirstConnection when the audio track is // mediastream received on gFirstConnection when the audio track is
// received. // received.
addExpectedEvent(); addExpectedEvent();
remote_stream_1.onaddtrack = function(){ remoteStream1.onaddtrack = function(){
assertEquals(remote_stream_1.getAudioTracks()[0].id, assertEquals(remoteStream1.getAudioTracks()[0].id,
local_stream.getAudioTracks()[0].id); localStream.getAudioTracks()[0].id);
eventOccured(); eventOccured();
} }
// Add an expectation that the received video track is removed from // Add an expectation that the received video track is removed from
// gFirstConnection. // gFirstConnection.
addExpectedEvent(); addExpectedEvent();
remote_stream_1.onremovetrack = function() { remoteStream1.onremovetrack = function() {
eventOccured(); eventOccured();
} }
// Add an expected event that onaddtrack will be called on the remote // Add an expected event that onaddtrack will be called on the remote
// mediastream received on gSecondConnection when the audio track is // mediastream received on gSecondConnection when the audio track is
// received. // received.
remote_stream_2 = gSecondConnection.getRemoteStreams()[0]; remoteStream2 = gSecondConnection.getRemoteStreams()[0];
addExpectedEvent(); addExpectedEvent();
remote_stream_2.onaddtrack = function() { remoteStream2.onaddtrack = function() {
assertEquals(remote_stream_2.getAudioTracks()[0].id, assertEquals(remoteStream2.getAudioTracks()[0].id,
local_stream.getAudioTracks()[0].id); localStream.getAudioTracks()[0].id);
eventOccured(); eventOccured();
} }
// Add an expectation that the received video track is removed from // Add an expectation that the received video track is removed from
// gSecondConnection. // gSecondConnection.
addExpectedEvent(); addExpectedEvent();
remote_stream_2.onremovetrack = function() { remoteStream2.onremovetrack = function() {
eventOccured(); eventOccured();
} }
// When all the above events have occurred- the test pass. // When all the above events have occurred- the test pass.
setAllEventsOccuredHandler(reportTestSuccess); setAllEventsOccuredHandler(reportTestSuccess);
local_stream.addTrack(gLocalStream.getAudioTracks()[0]); localStream.addTrack(gLocalStream.getAudioTracks()[0]);
local_stream.removeTrack(local_stream.getVideoTracks()[0]); localStream.removeTrack(localStream.getVideoTracks()[0]);
negotiate(); negotiate();
}); });
} }
...@@ -681,7 +681,7 @@ ...@@ -681,7 +681,7 @@
function addTwoMediaStreamsToOneConnection() { function addTwoMediaStreamsToOneConnection() {
createConnections(null); createConnections(null);
navigator.webkitGetUserMedia({audio: true, video: true}, navigator.webkitGetUserMedia({audio: true, video: true},
CloneStreamAndAddTwoStreamstoOneConnection, printGetUserMediaError); cloneStreamAndAddTwoStreamsToOneConnection, printGetUserMediaError);
} }
function onToneChange(tone) { function onToneChange(tone) {
...@@ -743,7 +743,7 @@ ...@@ -743,7 +743,7 @@
// Called if getUserMedia succeeds, then clone the stream, send two streams // Called if getUserMedia succeeds, then clone the stream, send two streams
// from one peer connection. // from one peer connection.
function CloneStreamAndAddTwoStreamstoOneConnection(localStream) { function cloneStreamAndAddTwoStreamsToOneConnection(localStream) {
displayAndRemember(localStream); displayAndRemember(localStream);
var clonedStream = null; var clonedStream = null;
...@@ -780,15 +780,14 @@ ...@@ -780,15 +780,14 @@
negotiate(); negotiate();
} }
// Called if getUserMedia succeeds when we want to send a modified // A new MediaStream is created with video track from |localStream| and is
// MediaStream. A new MediaStream is created and the video track from // added to both peer connections.
// |localStream| is added.
function createNewVideoStreamAndAddToBothConnections(localStream) { function createNewVideoStreamAndAddToBothConnections(localStream) {
displayAndRemember(localStream); displayAndRemember(localStream);
var new_stream = new webkitMediaStream(); var newStream = new webkitMediaStream();
new_stream.addTrack(localStream.getVideoTracks()[0]); newStream.addTrack(localStream.getVideoTracks()[0]);
gFirstConnection.addStream(new_stream); gFirstConnection.addStream(newStream);
gSecondConnection.addStream(new_stream); gSecondConnection.addStream(newStream);
negotiate(); negotiate();
} }
......
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