From 51532fd3554fc47c0d1087dc008e7b4fb99a7287 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Fri, 23 Feb 2024 19:04:55 +0100 Subject: [PATCH] Test handling of rejected m-lines without transport description adds a unit test for https://webrtc-review.googlesource.com/c/src/+/340322 which is a single m-line variant of the original fiddle that does not require renegotiation BUG=chromium:326493639 Change-Id: Icc5ebb1dda6502b00828a77e13b9f5fc865d34c4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/340500 Commit-Queue: Philipp Hancke Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#41818} --- pc/sdp_offer_answer_unittest.cc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/pc/sdp_offer_answer_unittest.cc b/pc/sdp_offer_answer_unittest.cc index f4c35bfd20..2e77f884e3 100644 --- a/pc/sdp_offer_answer_unittest.cc +++ b/pc/sdp_offer_answer_unittest.cc @@ -1215,4 +1215,31 @@ TEST_F(SdpOfferAnswerTest, cricket::kMsidSignalingNotUsed); } +TEST_F(SdpOfferAnswerTest, OfferWithRejectedMlineWithoutFingerprintIsAccepted) { + auto pc = CreatePeerConnection(); + // A rejected m-line without fingerprint. + // The answer does not require one. + std::string sdp = + "v=0\r\n" + "o=- 0 3 IN IP4 127.0.0.1\r\n" + "s=-\r\n" + "t=0 0\r\n" + "a=setup:actpass\r\n" + "a=ice-ufrag:ETEn\r\n" + "a=ice-pwd:OtSK0WpNtpUjkY4+86js7Z/l\r\n" + "m=audio 0 RTP/SAVPF 111\r\n" + "c=IN IP4 0.0.0.0\r\n" + "a=sendrecv\r\n" + "a=rtpmap:111 opus/48000/2\r\n" + "a=rtcp-mux\r\n"; + auto desc = CreateSessionDescription(SdpType::kOffer, sdp); + ASSERT_NE(desc, nullptr); + RTCError error; + pc->SetRemoteDescription(std::move(desc), &error); + EXPECT_TRUE(error.ok()); + + auto answer = pc->CreateAnswer(); + EXPECT_TRUE(pc->SetLocalDescription(std::move(answer))); +} + } // namespace webrtc