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

Unified Diff: base/task_scheduler/task_scheduler_impl_unittest.cc

Issue 2722113006: Revert of Introduce SchedulerSingleThreadTaskRunnerManager (Closed)
Patch Set: Created 3 years, 10 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_worker_pool_params.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_scheduler_impl_unittest.cc
diff --git a/base/task_scheduler/task_scheduler_impl_unittest.cc b/base/task_scheduler/task_scheduler_impl_unittest.cc
index bacedb7cf98747e75dc9f8987fe25b8e5027b026..6aaf4af8753cd16976280e8c0af0f56cbaeb93e9 100644
--- a/base/task_scheduler/task_scheduler_impl_unittest.cc
+++ b/base/task_scheduler/task_scheduler_impl_unittest.cc
@@ -322,49 +322,5 @@
TaskTraits().WithPriority(TaskPriority::USER_BLOCKING).MayBlock()));
}
-// Verify that the RunsTasksOnCurrentThread() method of a SequencedTaskRunner
-// returns false when called from a task that isn't part of the sequence.
-TEST_F(TaskSchedulerImplTest, SequencedRunsTasksOnCurrentThread) {
- auto single_thread_task_runner =
- scheduler_->CreateSingleThreadTaskRunnerWithTraits(TaskTraits());
- auto sequenced_task_runner =
- scheduler_->CreateSequencedTaskRunnerWithTraits(TaskTraits());
-
- WaitableEvent task_ran(WaitableEvent::ResetPolicy::MANUAL,
- WaitableEvent::InitialState::NOT_SIGNALED);
- single_thread_task_runner->PostTask(
- FROM_HERE,
- Bind(
- [](scoped_refptr<TaskRunner> sequenced_task_runner,
- WaitableEvent* task_ran) {
- EXPECT_FALSE(sequenced_task_runner->RunsTasksOnCurrentThread());
- task_ran->Signal();
- },
- sequenced_task_runner, Unretained(&task_ran)));
- task_ran.Wait();
-}
-
-// Verify that the RunsTasksOnCurrentThread() method of a SingleThreadTaskRunner
-// returns false when called from a task that isn't part of the sequence.
-TEST_F(TaskSchedulerImplTest, SingleThreadRunsTasksOnCurrentThread) {
- auto sequenced_task_runner =
- scheduler_->CreateSequencedTaskRunnerWithTraits(TaskTraits());
- auto single_thread_task_runner =
- scheduler_->CreateSingleThreadTaskRunnerWithTraits(TaskTraits());
-
- WaitableEvent task_ran(WaitableEvent::ResetPolicy::MANUAL,
- WaitableEvent::InitialState::NOT_SIGNALED);
- sequenced_task_runner->PostTask(
- FROM_HERE,
- Bind(
- [](scoped_refptr<TaskRunner> single_thread_task_runner,
- WaitableEvent* task_ran) {
- EXPECT_FALSE(single_thread_task_runner->RunsTasksOnCurrentThread());
- task_ran->Signal();
- },
- single_thread_task_runner, Unretained(&task_ran)));
- task_ran.Wait();
-}
-
} // namespace internal
} // namespace base
« no previous file with comments | « base/task_scheduler/scheduler_worker_pool_params.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698