Chromium Code Reviews| Index: base/test/scoped_task_environment.h |
| diff --git a/base/test/scoped_task_environment.h b/base/test/scoped_task_environment.h |
| index 04b9c75b1bf10ff3b5c8df2b4cbcbe950f92fd30..7b7180ae83292b2ed67b47c906f4a8b257637b31 100644 |
| --- a/base/test/scoped_task_environment.h |
| +++ b/base/test/scoped_task_environment.h |
| @@ -22,12 +22,14 @@ namespace test { |
| // ScopedTaskEnvironment. |
| // |
| // Tasks posted to the (Thread|Sequenced)TaskRunnerHandle run synchronously when |
| -// RunLoop::Run(UntilIdle) is called on the thread where the |
| -// ScopedTaskEnvironment lives. |
| +// RunLoop::Run(UntilIdle) or ScopedTaskEnvironment::RunUntilIdle is called on |
|
robliao
2017/05/09 21:52:52
Nit: RunUntilIdle()
|
| +// the thread where the ScopedTaskEnvironment lives. |
| // |
| // Tasks posted through base/task_scheduler/post_task.h run on dedicated threads |
| // as they are posted. |
| // |
| +// All methods of ScopedTaskEnvironment must be called from the same thread. |
| +// |
| // Usage: |
| // |
| // class MyTestFixture : public testing::Test { |
| @@ -66,6 +68,10 @@ class ScopedTaskEnvironment { |
| // the (Thread|Sequenced)TaskRunnerHandle. |
| ~ScopedTaskEnvironment(); |
| + // Synchronously runs (Thread|Sequenced)TaskRunnerHandle tasks until no |
| + // undelayed (Thread|Sequenced)TaskRunnerHandle or TaskScheduler tasks remain. |
| + void RunUntilIdle(); |
| + |
| private: |
| // Note: |message_loop_| is an implementation detail and will be replaced in |
| // the future, do NOT rely on the presence of a MessageLoop beyond |