Do not flush TaskScheduler in ~TestBrowserThreadBundle if it's not managed by it.
This fixes hangs in https://codereview.chromium.org/2890853002/.
New regression test hangs without matching test_browser_thread.cc
We support adding a TestBrowserThreadBundle on top of an explicit
ScopedTaskEnvironment (i.e. to add named threads in unit tests that
already otherwise inherit a ScopedTaskEnvironment or need to provide a
custom one). However if the ScopedTaskEnvironment uses a QUEUED mode,
trying to flush it in ~TestBrowserThreadBundle() results in a hang.
Flushing TaskScheduler when it's not managed by that
TestBrowserThreadBundle was wrong anyways.
Bug: 708584, 689520
Reviewed-by: Avi Drissman <email@example.com>
Commit-Queue: Gabriel Charette <firstname.lastname@example.org>
2 files changed