[ScopedTaskEnvironment] Explicitly allow and test nested FastForwardBy()
Discovered this use case @ https://chromium-review.googlesource.com/c/chromium/src/+/1686776/5 and extracted fix from it. An example of how this can happen is FtlMessageReceptionChannelTest.TimeoutIncreasesToMaximum which uses FastForwardBy from a GMOCK WillRepeatedly() hook. Also fix an issue in calls to AllowRunTasks(). Because of nesting and the way RunUntilIdle() works (with separate allow/disallow phases), it was possible to enter a nested call from either an allow/disallow phase and break the state on exit. This CL makes RunUntilIdle() always restore the previous state. This will also be required in https://chromium-review.googlesource.com/c/chromium/src/+/1686776 which will need to AllowRunTasks() from FastForwardBy(). R=fdoray@chromium.org Bug: 946657 Change-Id: I634a6ab89add3424383b4f105069b080d6fa25b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1687796 Commit-Queue: Gabriel Charette <gab@chromium.org> Reviewed-by:Alex Clarke <alexclarke@chromium.org> Reviewed-by:
François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#675704}
Showing
Please register or sign in to comment