Add a PeerConnection integration test for adding an audio track mid-call

BUG=None

Review-Url: https://codereview.webrtc.org/3007923002
Cr-Commit-Position: refs/heads/master@{#19731}
This commit is contained in:
deadbeef 2017-09-07 09:07:36 -07:00 committed by Commit Bot
parent 8180fa66de
commit 4389b4d96b

View File

@ -1393,8 +1393,7 @@ TEST_F(PeerConnectionIntegrationTest, AudioToVideoUpgrade) {
// Initially, offer an audio/video stream from the caller, but refuse to
// send/receive video on the callee side.
caller()->AddAudioVideoMediaStream();
callee()->AddMediaStreamFromTracks(callee()->CreateLocalAudioTrack(),
nullptr);
callee()->AddAudioOnlyMediaStream();
PeerConnectionInterface::RTCOfferAnswerOptions options;
options.offer_to_receive_video = 0;
callee()->SetOfferAnswerOptions(options);
@ -1425,6 +1424,30 @@ TEST_F(PeerConnectionIntegrationTest, AudioToVideoUpgrade) {
kMaxWaitForFramesMs);
}
// Simpler than the above test; just add an audio track to an established
// video-only connection.
TEST_F(PeerConnectionIntegrationTest, AddAudioToVideoOnlyCall) {
ASSERT_TRUE(CreatePeerConnectionWrappers());
ConnectFakeSignaling();
// Do initial offer/answer with just a video track.
caller()->AddVideoOnlyMediaStream();
callee()->AddVideoOnlyMediaStream();
caller()->CreateAndSetAndSignalOffer();
ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
// Now add an audio track and do another offer/answer.
caller()->AddMediaStreamFromTracksWithLabel(caller()->CreateLocalAudioTrack(),
nullptr, "audio_stream");
callee()->AddMediaStreamFromTracksWithLabel(callee()->CreateLocalAudioTrack(),
nullptr, "audio_stream");
caller()->CreateAndSetAndSignalOffer();
ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
// Ensure both audio and video frames are received end-to-end.
ExpectNewFramesReceivedWithWait(
kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount,
kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount,
kMaxWaitForFramesMs);
}
// This test sets up a call that's transferred to a new caller with a different
// DTLS fingerprint.
TEST_F(PeerConnectionIntegrationTest, CallTransferredForCallee) {