summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/pc/rtp_transport_unittest.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /third_party/libwebrtc/pc/rtp_transport_unittest.cc
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/pc/rtp_transport_unittest.cc')
-rw-r--r--third_party/libwebrtc/pc/rtp_transport_unittest.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/third_party/libwebrtc/pc/rtp_transport_unittest.cc b/third_party/libwebrtc/pc/rtp_transport_unittest.cc
index 5b6a8309e0..6b8e616799 100644
--- a/third_party/libwebrtc/pc/rtp_transport_unittest.cc
+++ b/third_party/libwebrtc/pc/rtp_transport_unittest.cc
@@ -349,4 +349,28 @@ TEST(RtpTransportTest, RecursiveSetSendDoesNotCrash) {
EXPECT_FALSE(observer.ready_to_send());
}
+TEST(RtpTransportTest, RecursiveOnSentPacketDoesNotCrash) {
+ const int kShortTimeout = 100;
+ test::RunLoop loop;
+ RtpTransport transport(kMuxEnabled);
+ rtc::FakePacketTransport fake_rtp("fake_rtp");
+ transport.SetRtpPacketTransport(&fake_rtp);
+ fake_rtp.SetDestination(&fake_rtp, true);
+ TransportObserver observer(&transport);
+ const rtc::PacketOptions options;
+ const int flags = 0;
+
+ fake_rtp.SetWritable(true);
+ observer.SetActionOnSentPacket([&]() {
+ rtc::CopyOnWriteBuffer rtp_data(kRtpData, kRtpLen);
+ if (observer.sent_packet_count() < 2) {
+ transport.SendRtpPacket(&rtp_data, options, flags);
+ }
+ });
+ rtc::CopyOnWriteBuffer rtp_data(kRtpData, kRtpLen);
+ transport.SendRtpPacket(&rtp_data, options, flags);
+ EXPECT_EQ(observer.sent_packet_count(), 1);
+ EXPECT_EQ_WAIT(observer.sent_packet_count(), 2, kShortTimeout);
+}
+
} // namespace webrtc