-
Gabriel Charette authored
This is a prerequesite to migrate ChromeBrowserPolicyConnector off of BrowserThread::FILE in https://chromium-review.googlesource.com/c/chromium/src/+/668556 i.e.: https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/511298 ChromeBrowserPolicyConnector is lazily instantiated when a callstack gets to TestingBrowserProcess::chrome_browser_policy_connector() which happens in a surprising amount of random places. The reason this worked before is that BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE) returns a lazy proxy which doesn't require that the BrowserThread::FILE actually be up and ready to receive tasks. base::CreateSequencedTaskRunnerWithTraits() however does require a TaskScheduler instance to be up (not necessarily started be at least instantiated, ref. Create/Start TaskScheduler semantics). While TaskScheduler *could* support lazy proxy task runners it has been unnecessary thus far and with this pretty much being the last use case for FILE thread we'd rather not go that route since it's cleaner anyways to have unit tests properly instantiate TestBrowserThreadBundle in the right order. This is mostly a trivial member re-ordering in each file except for RenderViewHostTestHarness which now initializes its TestBrowserThreadBundle at construction instead of SetUp() time so that it's done ahead of its subclasses' members. RenderViewHostTestHarness also drops the explicit ScopedTaskEnvironment member introduced in https://chromium-review.googlesource.com/c/chromium/src/+/575383 as it is not necessary to expose that to RunUntilIdle() (comment added in this CL in TestBrowserThreadBundle to clarify). Bug: 689520, 742303 Change-Id: I6fb81d45566838dd4d5a8c2c650519ddeeebf8af TBR=jam@chromium.org (see https://chromium-review.googlesource.com/c/chromium/src/+/671635#message-280432e2a1fbd0337d148ba64ad8aead69ab0bb7) Change-Id: I6fb81d45566838dd4d5a8c2c650519ddeeebf8af Reviewed-on: https://chromium-review.googlesource.com/671635 Commit-Queue: Gabriel Charette <gab@chromium.org> Reviewed-by: Gabriel Charette <gab@chromium.org> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org> Cr-Commit-Position: refs/heads/master@{#503262}
cc8362b4