Delete NO_MAIN_THREAD_WRAPPING preprocessor define.

Since many tests rely on rtc::Thread::Current(), add an
explicit rtc::AutoThread in the main() function used by tests.

Bug: webrtc:9714
Change-Id: Id82121967c9621fe1c2945846009c48139fa57da
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/39680
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28000}
This commit is contained in:
Niels Möller
2019-05-20 11:15:24 +02:00
committed by Commit Bot
parent e8602067db
commit 0f78c6b28d
10 changed files with 30 additions and 49 deletions

View File

@ -121,20 +121,6 @@ TEST_F(MessageQueueTest, DiposeHandlerWithPostedMessagePending) {
EXPECT_TRUE(deleted);
}
struct UnwrapMainThreadScope {
UnwrapMainThreadScope() : rewrap_(Thread::Current() != nullptr) {
if (rewrap_)
ThreadManager::Instance()->UnwrapCurrentThread();
}
~UnwrapMainThreadScope() {
if (rewrap_)
ThreadManager::Instance()->WrapCurrentThread();
}
private:
bool rewrap_;
};
// Ensure that ProcessAllMessageQueues does its essential function; process
// all messages (both delayed and non delayed) up until the current time, on
// all registered message queues.