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

Unified Diff: base/task_scheduler/scheduler_worker_pool_impl_unittest.cc

Issue 2590443005: Add TaskTraits::MayBlock and TaskTraits::WithSyncPrimitives. (Closed)
Patch Set: CR Created 4 years 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 | « no previous file | base/task_scheduler/task_scheduler_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 15591d2f69289e7dff6c0b79ded9b52424dc0028..ffc8ea165b64f346298646147515f02461987d89 100644
--- a/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc
+++ b/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc
@@ -115,7 +115,7 @@ scoped_refptr<TaskRunner> CreateTaskRunnerWithExecutionMode(
SchedulerWorkerPoolImpl* worker_pool,
test::ExecutionMode execution_mode) {
// Allow tasks posted to the returned TaskRunner to wait on a WaitableEvent.
- const TaskTraits traits = TaskTraits().WithWait();
+ const TaskTraits traits = TaskTraits().WithSyncPrimitives();
switch (execution_mode) {
case test::ExecutionMode::PARALLEL:
return worker_pool->CreateTaskRunnerWithTraits(traits);
@@ -543,7 +543,8 @@ TEST_F(TaskSchedulerWorkerPoolCheckTlsReuse, CheckDetachedThreads) {
std::vector<std::unique_ptr<test::TestTaskFactory>> factories;
for (size_t i = 0; i < kNumWorkersInWorkerPool; ++i) {
factories.push_back(MakeUnique<test::TestTaskFactory>(
- worker_pool_->CreateTaskRunnerWithTraits(TaskTraits().WithWait()),
+ worker_pool_->CreateTaskRunnerWithTraits(
+ TaskTraits().WithSyncPrimitives()),
test::ExecutionMode::PARALLEL));
ASSERT_TRUE(factories.back()->PostTask(
PostNestedTask::NO,
@@ -615,7 +616,7 @@ TEST_F(TaskSchedulerWorkerPoolHistogramTest, NumTasksBetweenWaits) {
WaitableEvent::InitialState::NOT_SIGNALED);
InitializeWorkerPool(TimeDelta::Max(), kNumWorkersInWorkerPool);
auto task_runner = worker_pool_->CreateSequencedTaskRunnerWithTraits(
- TaskTraits().WithWait());
+ TaskTraits().WithSyncPrimitives());
// Post a task.
task_runner->PostTask(FROM_HERE,
@@ -658,8 +659,8 @@ TEST_F(TaskSchedulerWorkerPoolHistogramTest, NumTasksBetweenWaitsWithDetach) {
WaitableEvent tasks_can_exit_event(WaitableEvent::ResetPolicy::MANUAL,
WaitableEvent::InitialState::NOT_SIGNALED);
InitializeWorkerPool(kReclaimTimeForDetachTests, kNumWorkersInWorkerPool);
- auto task_runner =
- worker_pool_->CreateTaskRunnerWithTraits(TaskTraits().WithWait());
+ auto task_runner = worker_pool_->CreateTaskRunnerWithTraits(
+ TaskTraits().WithSyncPrimitives());
// Post tasks to saturate the pool.
std::vector<std::unique_ptr<WaitableEvent>> task_started_events;
« no previous file with comments | « no previous file | base/task_scheduler/task_scheduler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698