Explicitly wrap main thread in test_main.cc.

Bug: webrtc:9714
Change-Id: I6ee234f9a0b88b3656a683f2455c3e4b2acf0d54
Reviewed-on: https://webrtc-review.googlesource.com/97683
Reviewed-by: Tommi <tommi@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24560}
This commit is contained in:
Niels Möller
2018-09-04 14:32:13 +02:00
committed by Commit Bot
parent 7f1ffcccce
commit 711a31aead
3 changed files with 15 additions and 6 deletions

View File

@ -10,6 +10,7 @@
#include "rtc_base/flags.h"
#include "rtc_base/logging.h"
#include "rtc_base/thread.h"
#include "system_wrappers/include/field_trial_default.h"
#include "system_wrappers/include/metrics_default.h"
#include "test/field_trial.h"
@ -87,6 +88,10 @@ int main(int argc, char* argv[]) {
rtc::LogMessage::SetLogToStderr(FLAG_logs);
// Ensure that main thread gets wrapped as an rtc::Thread.
rtc::ThreadManager::Instance()->WrapCurrentThread();
RTC_CHECK(rtc::Thread::Current());
#if defined(WEBRTC_IOS)
rtc::test::InitTestSuite(RUN_ALL_TESTS, argc, argv,