Fix deinit of BrowserThreadImpl in BrowserMainLoopTest.CreateThreadsInSingleProcess
BrowserMainLoop shuts down its BrowserThreadImpls, but SHUTDOWN is a
distinct state from UNINITIALIZED which is what BrowserThreadImpl expects
on initialization in the next test. Use ResetGlobalsForTesting() to
clear up lingering state.
This showed up on Fuchsia, but was cross-platform.
Bug: 759793, 754861
Change-Id: I2ffa5226e92e583ae317b8fb9f31bfce3e8e32ef
Reviewed-on: https://chromium-review.googlesource.com/639332
Commit-Queue: Scott Graham <[email protected]>
Reviewed-by: Nasko Oskov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#498723}
diff --git a/content/browser/browser_main_loop_unittest.cc b/content/browser/browser_main_loop_unittest.cc
index b91c16c..76fab428 100644
--- a/content/browser/browser_main_loop_unittest.cc
+++ b/content/browser/browser_main_loop_unittest.cc
@@ -34,6 +34,10 @@
base::SysInfo::NumberOfProcessors());
browser_main_loop.ShutdownThreadsAndCleanUp();
}
+ for (int id = BrowserThread::UI; id < BrowserThread::ID_COUNT; ++id) {
+ BrowserThreadImpl::ResetGlobalsForTesting(
+ static_cast<BrowserThread::ID>(id));
+ }
base::TaskScheduler::GetInstance()->JoinForTesting();
base::TaskScheduler::SetInstance(nullptr);
}