[Reland] Use the SequenceManager in ScopedTaskEnvironment

A reland of https://crrev.com/c/1324391

This is necessary because we want content::TestBrowserThreadBundle to
own a BrowserUIThreadScheduler, but that also owns a ScopedTaskEnvironment
and you can't have two SequenceManagers on the same thread.

This patch allows ScopedTaskEnvironment to optionally work with an
externally owned SequenceManager solving the problem.

This implements https://docs.google.com/document/d/1y08C6JQ9Yta3EQXzwIqqIIKHq9500WV6CWFZzZfDx7I/edit?usp=drivesdk,

We now have the ability to mock time on the UI thread.

TBR=asvitkine@chromium.org,miu@chromium.org,gab@chromium.org,fdoray@chromium.org

Bug: 863341, 891670, 708584
Change-Id: Ia4409b885deb9935e6e5b6d99f4598f164d350db
Reviewed-on: https://chromium-review.googlesource.com/c/1354919
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612122}
7 files changed