Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: webrtc/api/peerconnection_unittest.cc

Issue 2015763002: Making peerconnection_unittest use the virtual socket server it creates. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection_unittest.cc
diff --git a/webrtc/api/peerconnection_unittest.cc b/webrtc/api/peerconnection_unittest.cc
index 24411ab729060c09c9658aab987b49e0b9db85f5..d6506703f0d4fbd27836819c772a9479c38a562e 100644
--- a/webrtc/api/peerconnection_unittest.cc
+++ b/webrtc/api/peerconnection_unittest.cc
@@ -1028,11 +1028,10 @@ class PeerConnectionTestClient : public webrtc::PeerConnectionObserver,
class P2PTestConductor : public testing::Test {
public:
P2PTestConductor()
- : network_thread_(rtc::Thread::CreateWithSocketServer()),
- worker_thread_(rtc::Thread::Create()),
- pss_(new rtc::PhysicalSocketServer),
+ : pss_(new rtc::PhysicalSocketServer),
ss_(new rtc::VirtualSocketServer(pss_.get())),
- ss_scope_(ss_.get()) {
+ network_thread_(new rtc::Thread(ss_.get())),
+ worker_thread_(rtc::Thread::Create()) {
RTC_CHECK(network_thread_->Start());
RTC_CHECK(worker_thread_->Start());
}
@@ -1313,13 +1312,14 @@ class P2PTestConductor : public testing::Test {
}
private:
- // |worker_thread_| is used by both |initiating_client_| and
- // |receiving_client_|. Must be destroyed last.
- std::unique_ptr<rtc::Thread> network_thread_;
- std::unique_ptr<rtc::Thread> worker_thread_;
+ // |ss_| is used by |network_thread_| so it must be destroyed later.
std::unique_ptr<rtc::PhysicalSocketServer> pss_;
std::unique_ptr<rtc::VirtualSocketServer> ss_;
- rtc::SocketServerScope ss_scope_;
+ // |network_thread_| and |worker_thread_| are used by both
+ // |initiating_client_| and |receiving_client_| so they must be destroyed
+ // later.
+ std::unique_ptr<rtc::Thread> network_thread_;
+ std::unique_ptr<rtc::Thread> worker_thread_;
std::unique_ptr<PeerConnectionTestClient> initiating_client_;
std::unique_ptr<PeerConnectionTestClient> receiving_client_;
bool prefer_constraint_apis_ = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698