OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/task_scheduler/scheduler_thread_pool_impl.h" | 5 #include "base/task_scheduler/scheduler_thread_pool_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(TestDelayedTaskManager); | 51 DISALLOW_COPY_AND_ASSIGN(TestDelayedTaskManager); |
52 }; | 52 }; |
53 | 53 |
54 class TaskSchedulerThreadPoolImplTest | 54 class TaskSchedulerThreadPoolImplTest |
55 : public testing::TestWithParam<ExecutionMode> { | 55 : public testing::TestWithParam<ExecutionMode> { |
56 protected: | 56 protected: |
57 TaskSchedulerThreadPoolImplTest() = default; | 57 TaskSchedulerThreadPoolImplTest() = default; |
58 | 58 |
59 void SetUp() override { | 59 void SetUp() override { |
60 thread_pool_ = SchedulerThreadPoolImpl::CreateThreadPool( | 60 thread_pool_ = SchedulerThreadPoolImpl::Create( |
61 ThreadPriority::NORMAL, kNumThreadsInThreadPool, | 61 ThreadPriority::NORMAL, kNumThreadsInThreadPool, |
62 Bind(&TaskSchedulerThreadPoolImplTest::ReEnqueueSequenceCallback, | 62 Bind(&TaskSchedulerThreadPoolImplTest::ReEnqueueSequenceCallback, |
63 Unretained(this)), | 63 Unretained(this)), |
64 &task_tracker_, &delayed_task_manager_); | 64 &task_tracker_, &delayed_task_manager_); |
65 ASSERT_TRUE(thread_pool_); | 65 ASSERT_TRUE(thread_pool_); |
66 } | 66 } |
67 | 67 |
68 void TearDown() override { | 68 void TearDown() override { |
69 thread_pool_->WaitForAllWorkerThreadsIdleForTesting(); | 69 thread_pool_->WaitForAllWorkerThreadsIdleForTesting(); |
70 thread_pool_->JoinForTesting(); | 70 thread_pool_->JoinForTesting(); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 310 |
311 INSTANTIATE_TEST_CASE_P(Parallel, | 311 INSTANTIATE_TEST_CASE_P(Parallel, |
312 TaskSchedulerThreadPoolImplTest, | 312 TaskSchedulerThreadPoolImplTest, |
313 ::testing::Values(ExecutionMode::PARALLEL)); | 313 ::testing::Values(ExecutionMode::PARALLEL)); |
314 INSTANTIATE_TEST_CASE_P(Sequenced, | 314 INSTANTIATE_TEST_CASE_P(Sequenced, |
315 TaskSchedulerThreadPoolImplTest, | 315 TaskSchedulerThreadPoolImplTest, |
316 ::testing::Values(ExecutionMode::SEQUENCED)); | 316 ::testing::Values(ExecutionMode::SEQUENCED)); |
317 | 317 |
318 } // namespace internal | 318 } // namespace internal |
319 } // namespace base | 319 } // namespace base |
OLD | NEW |