Remove stopped transceivers at both local and remote SetDescription

This should ensure that the correct number of senders and receivers
are shown.

Bug: webtc:11840
Change-Id: Id57f8f9b1ceb8900abb3f92bcae79e5f0341de15
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184606
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32158}
This commit is contained in:
Harald Alvestrand
2020-09-22 07:41:50 +00:00
committed by Commit Bot
parent dd7df5c989
commit 6f4de80ddd
5 changed files with 82 additions and 51 deletions

View File

@ -1555,6 +1555,24 @@ TEST_F(PeerConnectionRtpTestUnifiedPlan,
ASSERT_TRUE(caller->ExchangeOfferAnswerWith(callee.get()));
}
TEST_F(PeerConnectionRtpTestUnifiedPlan,
StopAndNegotiateCausesTransceiverToDisappear) {
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());
EXPECT_EQ(0U, caller->pc()->GetTransceivers().size());
EXPECT_EQ(0U, callee->pc()->GetTransceivers().size());
EXPECT_EQ(0U, caller->pc()->GetSenders().size());
EXPECT_EQ(0U, callee->pc()->GetSenders().size());
EXPECT_EQ(0U, caller->pc()->GetReceivers().size());
EXPECT_EQ(0U, callee->pc()->GetReceivers().size());
}
// Test that AddTransceiver fails if trying to use unimplemented RTP encoding
// parameters with the send_encodings parameters.
TEST_F(PeerConnectionRtpTestUnifiedPlan,