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

Side by Side Diff: base/threading/sequenced_worker_pool_unittest.cc

Issue 2531883002: TaskScheduler: Set the IO allowed bit in TaskTracker::RunTask(). (Closed)
Patch Set: rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/threading/sequenced_worker_pool.h" 5 #include "base/threading/sequenced_worker_pool.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 public: 241 public:
242 SequencedWorkerPoolTest() 242 SequencedWorkerPoolTest()
243 : pool_owner_(new SequencedWorkerPoolOwner(kNumWorkerThreads, "test")), 243 : pool_owner_(new SequencedWorkerPoolOwner(kNumWorkerThreads, "test")),
244 tracker_(new TestTracker) {} 244 tracker_(new TestTracker) {}
245 245
246 void SetUp() override { 246 void SetUp() override {
247 if (RedirectedToTaskScheduler()) { 247 if (RedirectedToTaskScheduler()) {
248 std::vector<SchedulerWorkerPoolParams> worker_pool_params; 248 std::vector<SchedulerWorkerPoolParams> worker_pool_params;
249 worker_pool_params.emplace_back( 249 worker_pool_params.emplace_back(
250 "SchedulerWorkerPoolName", ThreadPriority::NORMAL, 250 "SchedulerWorkerPoolName", ThreadPriority::NORMAL,
251 SchedulerWorkerPoolParams::IORestriction::ALLOWED,
252 SchedulerWorkerPoolParams::StandbyThreadPolicy::LAZY, 251 SchedulerWorkerPoolParams::StandbyThreadPolicy::LAZY,
253 kNumWorkerThreads, TimeDelta::Max()); 252 kNumWorkerThreads, TimeDelta::Max());
254 TaskScheduler::CreateAndSetDefaultTaskScheduler( 253 TaskScheduler::CreateAndSetDefaultTaskScheduler(
255 std::move(worker_pool_params), 254 std::move(worker_pool_params),
256 base::Bind([](const TaskTraits&) -> size_t { return 0U; })); 255 base::Bind([](const TaskTraits&) -> size_t { return 0U; }));
257 256
258 // Unit tests run in an environment where SequencedWorkerPool is enabled 257 // Unit tests run in an environment where SequencedWorkerPool is enabled
259 // without redirection to TaskScheduler. For the current unit test, 258 // without redirection to TaskScheduler. For the current unit test,
260 // disable it and re-enable it with redirection to TaskScheduler. 259 // disable it and re-enable it with redirection to TaskScheduler.
261 SequencedWorkerPool::DisableForProcessForTesting(); 260 SequencedWorkerPool::DisableForProcessForTesting();
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 SequencedWorkerPoolSequencedTaskRunner, SequencedTaskRunnerTest, 1239 SequencedWorkerPoolSequencedTaskRunner, SequencedTaskRunnerTest,
1241 SequencedWorkerPoolSequencedTaskRunnerTestDelegate); 1240 SequencedWorkerPoolSequencedTaskRunnerTestDelegate);
1242 INSTANTIATE_TYPED_TEST_CASE_P( 1241 INSTANTIATE_TYPED_TEST_CASE_P(
1243 SequencedWorkerPoolSequencedTaskRunner, 1242 SequencedWorkerPoolSequencedTaskRunner,
1244 SequencedTaskRunnerDelayedTest, 1243 SequencedTaskRunnerDelayedTest,
1245 SequencedWorkerPoolSequencedTaskRunnerTestDelegate); 1244 SequencedWorkerPoolSequencedTaskRunnerTestDelegate);
1246 1245
1247 } // namespace 1246 } // namespace
1248 1247
1249 } // namespace base 1248 } // namespace base
OLDNEW
« no previous file with comments | « base/test/scoped_task_scheduler.cc ('k') | components/task_scheduler_util/initialization_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698