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

Unified Diff: webrtc/pc/peerconnection_integrationtest.cc

Issue 3007923002: Add a PeerConnection integration test for adding an audio track mid-call (Closed)
Patch Set: Created 3 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnection_integrationtest.cc
diff --git a/webrtc/pc/peerconnection_integrationtest.cc b/webrtc/pc/peerconnection_integrationtest.cc
index d20e2f965b5a43cbaf543689a97c2bd4b67dcf29..6b3ddd55bff4fb4ca58ef5b3757df3fb726c06b2 100644
--- a/webrtc/pc/peerconnection_integrationtest.cc
+++ b/webrtc/pc/peerconnection_integrationtest.cc
@@ -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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698