From bf7532116bba0a1d565cb8ff11d71e3f40bd2e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Mon, 22 Nov 2021 09:12:04 +0100 Subject: [PATCH] Create socket server explicitly in PeerConnectionEndToEndBaseTest Bug: webrtc:13145 Change-Id: I674382b3a784d371681426848461502b711dfe6a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238430 Auto-Submit: Niels Moller Commit-Queue: Taylor Brandstetter Reviewed-by: Taylor Brandstetter Cr-Commit-Position: refs/heads/main@{#35435} --- pc/peer_connection_end_to_end_unittest.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc index 4ef4c832bb..a4704c0b7d 100644 --- a/pc/peer_connection_end_to_end_unittest.cc +++ b/pc/peer_connection_end_to_end_unittest.cc @@ -21,6 +21,7 @@ #include "media/sctp/sctp_transport_internal.h" #include "rtc_base/gunit.h" #include "rtc_base/logging.h" +#include "rtc_base/physical_socket_server.h" #ifdef WEBRTC_ANDROID #include "pc/test/android_test_initializer.h" @@ -54,9 +55,9 @@ class PeerConnectionEndToEndBaseTest : public sigslot::has_slots<>, public: typedef std::vector> DataChannelList; - explicit PeerConnectionEndToEndBaseTest(SdpSemantics sdp_semantics) { - network_thread_ = rtc::Thread::CreateWithSocketServer(); - worker_thread_ = rtc::Thread::Create(); + explicit PeerConnectionEndToEndBaseTest(SdpSemantics sdp_semantics) + : network_thread_(std::make_unique(&pss_)), + worker_thread_(rtc::Thread::Create()) { RTC_CHECK(network_thread_->Start()); RTC_CHECK(worker_thread_->Start()); caller_ = new rtc::RefCountedObject( @@ -191,6 +192,7 @@ class PeerConnectionEndToEndBaseTest : public sigslot::has_slots<>, } protected: + rtc::PhysicalSocketServer pss_; std::unique_ptr network_thread_; std::unique_ptr worker_thread_; rtc::scoped_refptr caller_;