Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Side by Side Diff: base/task_scheduler/scheduler_thread_pool_impl_unittest.cc

Issue 1903103007: TaskScheduler: Make SchedulerWorkerThread own its delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sched_2b_remove_utils
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « base/task_scheduler/scheduler_thread_pool_impl.cc ('k') | base/task_scheduler/scheduler_worker_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698