Chromium Code Reviews| Index: base/task_scheduler/scheduler_worker_pool_impl_unittest.cc |
| diff --git a/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc b/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc |
| index 81eead0e584f9d9e1fa81446a614adab0e589a23..b290a845b2773eb3ec49f7f065261f56f177254a 100644 |
| --- a/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc |
| +++ b/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc |
| @@ -72,7 +72,7 @@ class TaskSchedulerWorkerPoolImplTest |
| } |
| void TearDown() override { |
| - worker_pool_->WaitForAllWorkerWorkersIdleForTesting(); |
| + worker_pool_->WaitForAllWorkersIdleForTesting(); |
| worker_pool_->JoinForTesting(); |
| } |
| @@ -104,7 +104,7 @@ class ThreadPostingTasks : public SimpleThread { |
| // Constructs a thread that posts tasks to |worker_pool| through an |
| // |execution_mode| task runner. If |wait_before_post_task| is |
| - // WAIT_FOR_ALL_THREADS_IDLE, the thread waits until all worker threads in |
| + // WAIT_FOR_ALL_THREADS_IDLE, the thread waits until all workers in |
| // |worker_pool| are idle before posting a new task. If |post_nested_task| is |
| // YES, each task posted by this thread posts another task when it runs. |
| ThreadPostingTasks(SchedulerWorkerPoolImpl* worker_pool, |
| @@ -130,7 +130,7 @@ class ThreadPostingTasks : public SimpleThread { |
| for (size_t i = 0; i < kNumTasksPostedPerThread; ++i) { |
| if (wait_before_post_task_ == |
| WaitBeforePostTask::WAIT_FOR_ALL_THREADS_IDLE) { |
| - worker_pool_->WaitForAllWorkerWorkersIdleForTesting(); |
| + worker_pool_->WaitForAllWorkersIdleForTesting(); |
| } |
| EXPECT_TRUE(factory_.PostTask(post_nested_task_, Closure())); |
| } |
| @@ -169,15 +169,15 @@ TEST_P(TaskSchedulerWorkerPoolImplTest, PostTasks) { |
| thread_posting_tasks->factory()->WaitForAllTasksToRun(); |
| } |
| - // Wait until all worker threads are idle to be sure that no task accesses |
| + // Wait until all workers are idle to be sure that no task accesses |
| // its TestTaskFactory after |thread_posting_tasks| is destroyed. |
| - worker_pool_->WaitForAllWorkerWorkersIdleForTesting(); |
| + worker_pool_->WaitForAllWorkersIdleForTesting(); |
| } |
| TEST_P(TaskSchedulerWorkerPoolImplTest, PostTasksWaitAllThreadsIdle) { |
|
fdoray
2016/06/20 15:08:40
WaitAllWorkersIdle
robliao
2016/06/20 17:50:09
Done.
|
| - // Create threads to post tasks. To verify that worker threads can sleep and |
| - // be woken up when new tasks are posted, wait for all threads to become idle |
| - // before posting a new task. |
| + // Create threads to post tasks. To verify that workers can sleep and be woken |
| + // up when new tasks are posted, wait for all threads to become idle before |
|
fdoray
2016/06/20 15:08:40
for all *workers* to become
robliao
2016/06/20 17:50:09
Done.
|
| + // posting a new task. |
| std::vector<std::unique_ptr<ThreadPostingTasks>> threads_posting_tasks; |
| for (size_t i = 0; i < kNumThreadsPostingTasks; ++i) { |
| threads_posting_tasks.push_back(WrapUnique(new ThreadPostingTasks( |
| @@ -192,9 +192,9 @@ TEST_P(TaskSchedulerWorkerPoolImplTest, PostTasksWaitAllThreadsIdle) { |
| thread_posting_tasks->factory()->WaitForAllTasksToRun(); |
| } |
| - // Wait until all worker threads are idle to be sure that no task accesses |
| - // its TestTaskFactory after |thread_posting_tasks| is destroyed. |
| - worker_pool_->WaitForAllWorkerWorkersIdleForTesting(); |
| + // Wait until all workers are idle to be sure that no task accesses its |
| + // TestTaskFactory after |thread_posting_tasks| is destroyed. |
| + worker_pool_->WaitForAllWorkersIdleForTesting(); |
| } |
| TEST_P(TaskSchedulerWorkerPoolImplTest, NestedPostTasks) { |
| @@ -214,9 +214,9 @@ TEST_P(TaskSchedulerWorkerPoolImplTest, NestedPostTasks) { |
| thread_posting_tasks->factory()->WaitForAllTasksToRun(); |
| } |
| - // Wait until all worker threads are idle to be sure that no task accesses |
| - // its TestTaskFactory after |thread_posting_tasks| is destroyed. |
| - worker_pool_->WaitForAllWorkerWorkersIdleForTesting(); |
| + // Wait until all workers are idle to be sure that no task accesses its |
| + // TestTaskFactory after |thread_posting_tasks| is destroyed. |
| + worker_pool_->WaitForAllWorkersIdleForTesting(); |
| } |
| TEST_P(TaskSchedulerWorkerPoolImplTest, PostTasksWithOneAvailableThread) { |
|
fdoray
2016/06/20 15:08:40
OneAvailableWorker
robliao
2016/06/20 17:50:09
Done.
|
| @@ -247,9 +247,9 @@ TEST_P(TaskSchedulerWorkerPoolImplTest, PostTasksWithOneAvailableThread) { |
| // Release tasks waiting on |event|. |
| event.Signal(); |
| - // Wait until all worker threads are idle to be sure that no task accesses |
| + // Wait until all workers are idle to be sure that no task accesses |
| // its TestTaskFactory after it is destroyed. |
| - worker_pool_->WaitForAllWorkerWorkersIdleForTesting(); |
| + worker_pool_->WaitForAllWorkersIdleForTesting(); |
| } |
| TEST_P(TaskSchedulerWorkerPoolImplTest, Saturate) { |
| @@ -272,9 +272,9 @@ TEST_P(TaskSchedulerWorkerPoolImplTest, Saturate) { |
| // Release tasks waiting on |event|. |
| event.Signal(); |
| - // Wait until all worker threads are idle to be sure that no task accesses |
| + // Wait until all workers are idle to be sure that no task accesses |
| // its TestTaskFactory after it is destroyed. |
| - worker_pool_->WaitForAllWorkerWorkersIdleForTesting(); |
| + worker_pool_->WaitForAllWorkersIdleForTesting(); |
| } |
| // Verify that a Task can't be posted after shutdown. |