Index: webrtc/rtc_base/timeutils_unittest.cc |
diff --git a/webrtc/rtc_base/timeutils_unittest.cc b/webrtc/rtc_base/timeutils_unittest.cc |
index 5fd94365b1fe13807653c2e50b77de6a327ecccb..a409fb679cfff478027ea4b6b3c91626e6781e6a 100644 |
--- a/webrtc/rtc_base/timeutils_unittest.cc |
+++ b/webrtc/rtc_base/timeutils_unittest.cc |
@@ -349,8 +349,8 @@ TEST(FakeClock, SettingTimeWakesThreads) { |
FakeClock clock; |
SetClockForTesting(&clock); |
- Thread worker; |
- worker.Start(); |
+ std::unique_ptr<Thread> worker(Thread::CreateWithSocketServer()); |
+ worker->Start(); |
// Post an event that won't be executed for 10 seconds. |
Event message_handler_dispatched(false, false); |
@@ -358,7 +358,7 @@ TEST(FakeClock, SettingTimeWakesThreads) { |
message_handler_dispatched.Set(); |
}; |
FunctorMessageHandler<void, decltype(functor)> handler(functor); |
- worker.PostDelayed(RTC_FROM_HERE, 60000, &handler); |
+ worker->PostDelayed(RTC_FROM_HERE, 60000, &handler); |
// Wait for a bit for the worker thread to be started and enter its socket |
// select(). Otherwise this test would be trivial since the worker thread |
@@ -369,7 +369,7 @@ TEST(FakeClock, SettingTimeWakesThreads) { |
// and dispatch the message instantly. |
clock.AdvanceTime(TimeDelta::FromSeconds(60u)); |
EXPECT_TRUE(message_handler_dispatched.Wait(0)); |
- worker.Stop(); |
+ worker->Stop(); |
SetClockForTesting(nullptr); |