Index: webrtc/base/virtualsocket_unittest.cc |
diff --git a/webrtc/base/virtualsocket_unittest.cc b/webrtc/base/virtualsocket_unittest.cc |
index e2f1d05f16f446fdaf4b95c36074978cff47606f..d2af16a7777c49ca5684562f88c1dbfb904697b8 100644 |
--- a/webrtc/base/virtualsocket_unittest.cc |
+++ b/webrtc/base/virtualsocket_unittest.cc |
@@ -146,6 +146,7 @@ class VirtualSocketServerTest : public testing::Test { |
public: |
VirtualSocketServerTest() |
: ss_(new VirtualSocketServer(nullptr)), |
+ thread_(ss_.get()), |
kIPv4AnyAddress(IPAddress(INADDR_ANY), 0), |
kIPv6AnyAddress(IPAddress(in6addr_any), 0) {} |
@@ -227,7 +228,7 @@ class VirtualSocketServerTest : public testing::Test { |
SocketAddress empty = EmptySocketAddressWithFamily(initial_addr.family()); |
for (int i = 0; i < 10; i++) { |
- client2 = new TestClient(AsyncUDPSocket::Create(ss_, empty)); |
+ client2 = new TestClient(AsyncUDPSocket::Create(ss_.get(), empty)); |
SocketAddress next_client2_addr; |
EXPECT_EQ(3, client2->SendTo("foo", 3, server_addr)); |
@@ -822,12 +823,8 @@ class VirtualSocketServerTest : public testing::Test { |
} |
protected: |
- virtual void SetUp() { |
- Thread::Current()->set_socketserver(ss_); |
- } |
- virtual void TearDown() { Thread::Current()->set_socketserver(nullptr); } |
- |
- VirtualSocketServer* ss_; |
+ std::unique_ptr<VirtualSocketServer> ss_; |
+ AutoSocketServerThread thread_; |
const SocketAddress kIPv4AnyAddress; |
const SocketAddress kIPv6AnyAddress; |
}; |