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

Unified Diff: third_party/WebKit/Source/platform/scheduler/child/scheduler_helper_unittest.cc

Issue 2540663002: Add the concept of QueueEnabledVoters to blink scheduler TaskQueue (Closed)
Patch Set: Fix test crashes and address feedback. Created 4 years, 1 month 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
Index: third_party/WebKit/Source/platform/scheduler/child/scheduler_helper_unittest.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/child/scheduler_helper_unittest.cc b/third_party/WebKit/Source/platform/scheduler/child/scheduler_helper_unittest.cc
index 4e212b53eaeb80aaa3f9eb8c8826797aae0d4149..743cc16428026c63cde8a3e6907bee090dfbed1f 100644
--- a/third_party/WebKit/Source/platform/scheduler/child/scheduler_helper_unittest.cc
+++ b/third_party/WebKit/Source/platform/scheduler/child/scheduler_helper_unittest.cc
@@ -216,13 +216,15 @@ TEST_F(SchedulerHelperTest, OnTriedToExecuteBlockedTask) {
scoped_refptr<TaskQueue> task_queue = scheduler_helper_->NewTaskQueue(
TaskQueue::Spec(TaskQueue::QueueType::TEST)
.SetShouldReportWhenExecutionBlocked(true));
- task_queue->SetQueueEnabled(false);
+ std::unique_ptr<TaskQueue::QueueEnabledVoter> voter =
+ task_queue->CreateQueueEnabledVoter();
+ voter->SetQueueEnabled(false);
task_queue->PostTask(FROM_HERE, base::Bind(&NopTask));
// Trick |task_queue| into posting a DoWork. By default PostTask with a
// disabled queue won't post a DoWork until we enable the queue.
- task_queue->SetQueueEnabled(true);
- task_queue->SetQueueEnabled(false);
+ voter->SetQueueEnabled(true);
+ voter->SetQueueEnabled(false);
EXPECT_CALL(observer, OnTriedToExecuteBlockedTask(_, _)).Times(1);
RunUntilIdle();

Powered by Google App Engine
This is Rietveld 408576698