Expose a TickClock on ScopedTaskEnvironment |
||
Issue descriptionCurrently, if a test needs to post delayed tasks and access a coherent time source from these delayed tasks, it has to create a MOCK_TIME ScopedTaskEnvironment and a SimpleTestTickClock, and advance both at the same time (e.g. https://chromium-review.googlesource.com/c/chromium/src/+/879225/3/services/resource_coordinator/observers/page_signal_generator_impl_unittest.cc#217). It would be better if ScopedTaskEnvironment exposed a TickClock. Calling ScopedTaskEnvironment::FastForwardBy/FastForwardUntilNoTasksRemain() would both run delayed tasks and advance the time of the exposed TickClock. To implement this, would would simply need to add a method on ScopedTaskEnvironment that would return the TestMockTimeTaskRunner's TickClock.
,
Feb 2 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e34860631da29d5d7d1910e6dfa1d96c7f5a1d11 commit e34860631da29d5d7d1910e6dfa1d96c7f5a1d11 Author: Sebastien Marchand <sebmarchand@chromium.org> Date: Fri Feb 02 16:48:59 2018 Expose a TickClock on ScopedTaskEnvironment Bug: 806265 Change-Id: I4820b88096de01aa134715ebbe6cb1556d91b4ec Reviewed-on: https://chromium-review.googlesource.com/888094 Reviewed-by: Gabriel Charette <gab@chromium.org> Reviewed-by: François Doray <fdoray@chromium.org> Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org> Cr-Commit-Position: refs/heads/master@{#534072} [modify] https://crrev.com/e34860631da29d5d7d1910e6dfa1d96c7f5a1d11/base/test/scoped_task_environment.cc [modify] https://crrev.com/e34860631da29d5d7d1910e6dfa1d96c7f5a1d11/base/test/scoped_task_environment.h [modify] https://crrev.com/e34860631da29d5d7d1910e6dfa1d96c7f5a1d11/base/test/scoped_task_environment_unittest.cc
,
Feb 5 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by gab@chromium.org
, Jan 28 2018