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

Unified Diff: base/task_scheduler/scheduler_thread_pool_impl_unittest.cc

Issue 2032603002: Migrate WaitableEvent to enum-based constructor in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: undo incorrect template change Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/task_scheduler/scheduler_thread_pool_impl.cc ('k') | base/task_scheduler/scheduler_worker_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_thread_pool_impl_unittest.cc
diff --git a/base/task_scheduler/scheduler_thread_pool_impl_unittest.cc b/base/task_scheduler/scheduler_thread_pool_impl_unittest.cc
index 8af2c52ffeaffb4cf69ad8ac0d791d517f824bc5..15777400e6f3368c620485dfc7d71a91490cf8c5 100644
--- a/base/task_scheduler/scheduler_thread_pool_impl_unittest.cc
+++ b/base/task_scheduler/scheduler_thread_pool_impl_unittest.cc
@@ -223,7 +223,8 @@ TEST_P(TaskSchedulerThreadPoolImplTest, PostTasksWithOneAvailableThread) {
// Post blocking tasks to keep all threads busy except one until |event| is
// signaled. Use different factories so that tasks are added to different
// sequences and can run simultaneously when the execution mode is SEQUENCED.
- WaitableEvent event(true, false);
+ WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL,
+ WaitableEvent::InitialState::NOT_SIGNALED);
std::vector<std::unique_ptr<test::TestTaskFactory>> blocked_task_factories;
for (size_t i = 0; i < (kNumThreadsInThreadPool - 1); ++i) {
blocked_task_factories.push_back(WrapUnique(new test::TestTaskFactory(
@@ -256,7 +257,8 @@ TEST_P(TaskSchedulerThreadPoolImplTest, Saturate) {
// tasks/sequences running simultaneously. Use different factories so that the
// blocking tasks are added to different sequences and can run simultaneously
// when the execution mode is SEQUENCED.
- WaitableEvent event(true, false);
+ WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL,
+ WaitableEvent::InitialState::NOT_SIGNALED);
std::vector<std::unique_ptr<test::TestTaskFactory>> factories;
for (size_t i = 0; i < kNumThreadsInThreadPool; ++i) {
factories.push_back(WrapUnique(new test::TestTaskFactory(
@@ -289,7 +291,8 @@ TEST_P(TaskSchedulerThreadPoolImplTest, PostDelayedTask) {
EXPECT_TRUE(delayed_task_manager_.GetDelayedRunTime().is_null());
// Post a delayed task.
- WaitableEvent task_ran(true, false);
+ WaitableEvent task_ran(WaitableEvent::ResetPolicy::MANUAL,
+ WaitableEvent::InitialState::NOT_SIGNALED);
EXPECT_TRUE(thread_pool_->CreateTaskRunnerWithTraits(TaskTraits(), GetParam())
->PostDelayedTask(FROM_HERE, Bind(&WaitableEvent::Signal,
Unretained(&task_ran)),
@@ -365,7 +368,8 @@ TEST_P(TaskSchedulerThreadPoolImplIORestrictionTest, IORestriction) {
&delayed_task_manager);
ASSERT_TRUE(thread_pool);
- WaitableEvent task_ran(true, false);
+ WaitableEvent task_ran(WaitableEvent::ResetPolicy::MANUAL,
+ WaitableEvent::InitialState::NOT_SIGNALED);
thread_pool->CreateTaskRunnerWithTraits(TaskTraits(), ExecutionMode::PARALLEL)
->PostTask(FROM_HERE, Bind(&ExpectIORestriction, GetParam(), &task_ran));
task_ran.Wait();
« no previous file with comments | « base/task_scheduler/scheduler_thread_pool_impl.cc ('k') | base/task_scheduler/scheduler_worker_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698