Use the SequenceManager in ScopedTaskEnvironment

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,

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

Bug: 863341, 891670, 708584
Change-Id: I96aa34c5cc8832c263621c2d9c228a8da4372c68
Commit-Queue: Alex Clarke <>
Reviewed-by: Gabriel Charette <>
Reviewed-by: Fran├žois Doray <>
Cr-Commit-Position: refs/heads/master@{#611895}
7 files changed