From 198cd730115cc8befc743abe6ec88163b56da138 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 16 Sep 2020 12:41:23 +0000 Subject: [PATCH] Test for negotiating pre-stopped M-sections. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for issue is in https://webrtc-review.googlesource.com/c/src/+/184343 Bug: chromium:1127625 Change-Id: I11bcde82b7e03a160b5ee078a9c5edf7f2e31902 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184344 Reviewed-by: Philipp Hancke Reviewed-by: Henrik Boström Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#32119} --- pc/peer_connection_rtp_unittest.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pc/peer_connection_rtp_unittest.cc b/pc/peer_connection_rtp_unittest.cc index 152a12ead7..44f105b1d9 100644 --- a/pc/peer_connection_rtp_unittest.cc +++ b/pc/peer_connection_rtp_unittest.cc @@ -1540,6 +1540,21 @@ TEST_F(PeerConnectionRtpTestUnifiedPlan, .type()); } +// Test that you can do createOffer/setLocalDescription with a stopped +// media section. +TEST_F(PeerConnectionRtpTestUnifiedPlan, + SetLocalDescriptionWithStoppedMediaSection) { + auto caller = CreatePeerConnection(); + auto callee = CreatePeerConnection(); + auto transceiver = caller->AddTransceiver(cricket::MEDIA_TYPE_AUDIO); + ASSERT_TRUE(caller->ExchangeOfferAnswerWith(callee.get())); + callee->pc()->GetTransceivers()[0]->StopStandard(); + ASSERT_TRUE(callee->ExchangeOfferAnswerWith(caller.get())); + EXPECT_EQ(RtpTransceiverDirection::kStopped, + transceiver->current_direction()); + ASSERT_TRUE(caller->ExchangeOfferAnswerWith(callee.get())); +} + // Test that AddTransceiver fails if trying to use unimplemented RTP encoding // parameters with the send_encodings parameters. TEST_F(PeerConnectionRtpTestUnifiedPlan,