RecentTabHelper tests: don't use navigation auto advance

The recent tab helper tests swap out the main thread with their own
custom task runner (used for fast forwarding time). However, this
doesn't work well with the NavigationSimulation, which internally uses
base::RunLoop to pump tasks.

Any code that adds an async action that delays navigation commit will
hang these tests, and the AsyncNavigationIntercept experiment does
just this.

To fix, disable NavigationSimulator from pumping / waiting for task
completion internally, by setting AutoAdvance to false. Then within the
test, manually run tasks on the task runner after start.

This is a bit of a hacky fix (since it is special casing nav start).
But there are three possible paths forward:
1. RenderViewHostTestHarness tests can support fast forwarding natively,
   as well as pumping tasks with base::RunLoop by having its type be
   kBoundToThread. Not sure how much work this would entail.

2. RecentTabHelper can be refactored to use mock timers rather than
   PostDelayedTasks.

3. NavigationSimulator can be improved by allowing callers to inject
   their task runner before starting the navigation, so the simulator
   can pump tasks correctly.

Bug: 793053
Change-Id: I43edda78a0236d8357d8ecf9a8f7db55c421b422
Reviewed-on: https://chromium-review.googlesource.com/c/1458477
Reviewed-by: Carlos Knippschild <carlosk@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Auto-Submit: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630147}
1 file changed