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 <nisse@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35435}
diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc
index 4ef4c83..a4704c0 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 @@
public:
typedef std::vector<rtc::scoped_refptr<DataChannelInterface>> 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<rtc::Thread>(&pss_)),
+ worker_thread_(rtc::Thread::Create()) {
RTC_CHECK(network_thread_->Start());
RTC_CHECK(worker_thread_->Start());
caller_ = new rtc::RefCountedObject<PeerConnectionTestWrapper>(
@@ -191,6 +192,7 @@
}
protected:
+ rtc::PhysicalSocketServer pss_;
std::unique_ptr<rtc::Thread> network_thread_;
std::unique_ptr<rtc::Thread> worker_thread_;
rtc::scoped_refptr<PeerConnectionTestWrapper> caller_;