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

Unified Diff: components/scheduler/base/task_queue_manager_unittest.cc

Issue 2132593002: Remove remaining calls to deprecated MessageLoop methods on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: h264_vt_encoder_unittest.cc Created 4 years, 5 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
Index: components/scheduler/base/task_queue_manager_unittest.cc
diff --git a/components/scheduler/base/task_queue_manager_unittest.cc b/components/scheduler/base/task_queue_manager_unittest.cc
index 89493b12c65e8313f767728585b892f74d019065..fe5921ca60315e4fb26ad0636e8b0718ac0a5cd2 100644
--- a/components/scheduler/base/task_queue_manager_unittest.cc
+++ b/components/scheduler/base/task_queue_manager_unittest.cc
@@ -153,7 +153,7 @@ TEST_F(TaskQueueManagerTest,
runners_[2]->PostTask(FROM_HERE, base::Bind(&NopTask));
runners_[2]->PostTask(FROM_HERE, base::Bind(&NopTask));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// We need to call Now for the beginning of the first task, and then the end
// of every task after. We reuse the end time of one task for the start time
// of the next task. In this case, there were 6 tasks, so we expect 7 calls to
@@ -188,7 +188,7 @@ TEST_F(TaskQueueManagerTest,
base::RetainedRef(runners_[0]),
base::Unretained(&tasks_to_post_from_nested_loop)));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// We need to call Now twice, to measure the start and end of the outermost
// task. We shouldn't call it for any of the nested tasks.
EXPECT_EQ(2, test_count_uses_time_source->now_calls_count());
@@ -234,7 +234,7 @@ TEST_F(TaskQueueManagerTest, NonNestableTaskPosting) {
runners_[0]->PostNonNestableTask(FROM_HERE,
base::Bind(&TestTask, 1, &run_order));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_THAT(run_order, ElementsAre(1));
}
@@ -249,7 +249,7 @@ TEST_F(TaskQueueManagerTest, NonNestableTaskExecutesInExpectedOrder) {
runners_[0]->PostNonNestableTask(FROM_HERE,
base::Bind(&TestTask, 5, &run_order));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_THAT(run_order, ElementsAre(1, 2, 3, 4, 5));
}
@@ -273,7 +273,7 @@ TEST_F(TaskQueueManagerTest, NonNestableTaskDoesntExecuteInNestedLoop) {
base::RetainedRef(runners_[0]),
base::Unretained(&tasks_to_post_from_nested_loop)));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Note we expect task 3 to run last because it's non-nestable.
EXPECT_THAT(run_order, ElementsAre(1, 2, 4, 5, 3));
}
@@ -642,7 +642,7 @@ TEST_F(TaskQueueManagerTest, PostFromThread) {
FROM_HERE, base::Bind(&PostTaskToRunner, runners_[0], &run_order));
thread.Stop();
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_THAT(run_order, ElementsAre(1));
}
@@ -682,7 +682,7 @@ TEST_F(TaskQueueManagerTest, PostFromNestedRunloop) {
base::Unretained(&tasks_to_post_from_nested_loop)));
runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_THAT(run_order, ElementsAre(0, 2, 1));
}
@@ -872,7 +872,7 @@ TEST_F(TaskQueueManagerTest, TaskObserverAdding) {
EXPECT_CALL(observer, WillProcessTask(_)).Times(2);
EXPECT_CALL(observer, DidProcessTask(_)).Times(2);
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(TaskQueueManagerTest, TaskObserverRemoving) {
@@ -888,7 +888,7 @@ TEST_F(TaskQueueManagerTest, TaskObserverRemoving) {
EXPECT_CALL(observer, WillProcessTask(_)).Times(0);
EXPECT_CALL(observer, DidProcessTask(_)).Times(0);
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
void RemoveObserverTask(TaskQueueManager* manager,
@@ -907,7 +907,7 @@ TEST_F(TaskQueueManagerTest, TaskObserverRemovingInsideTask) {
EXPECT_CALL(observer, WillProcessTask(_)).Times(1);
EXPECT_CALL(observer, DidProcessTask(_)).Times(0);
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(TaskQueueManagerTest, QueueTaskObserverAdding) {
@@ -923,7 +923,7 @@ TEST_F(TaskQueueManagerTest, QueueTaskObserverAdding) {
EXPECT_CALL(observer, WillProcessTask(_)).Times(1);
EXPECT_CALL(observer, DidProcessTask(_)).Times(1);
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(TaskQueueManagerTest, QueueTaskObserverRemoving) {
@@ -939,7 +939,7 @@ TEST_F(TaskQueueManagerTest, QueueTaskObserverRemoving) {
EXPECT_CALL(observer, WillProcessTask(_)).Times(0);
EXPECT_CALL(observer, DidProcessTask(_)).Times(0);
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
void RemoveQueueObserverTask(scoped_refptr<TaskQueue> queue,
@@ -957,7 +957,7 @@ TEST_F(TaskQueueManagerTest, QueueTaskObserverRemovingInsideTask) {
EXPECT_CALL(observer, WillProcessTask(_)).Times(1);
EXPECT_CALL(observer, DidProcessTask(_)).Times(0);
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
TEST_F(TaskQueueManagerTest, ThreadCheckAfterTermination) {
@@ -1261,7 +1261,7 @@ TEST_F(TaskQueueManagerTest, QuitWhileNested) {
base::RetainedRef(runners_[0]),
base::Unretained(&was_nested)));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_FALSE(was_nested);
}
@@ -1421,7 +1421,7 @@ TEST_F(TaskQueueManagerTest, DeferredNonNestableTaskDoesNotTriggerWakeUp) {
base::Bind(&PostTestTasksFromNestedMessageLoop, message_loop_.get(),
runners_[0], runners_[1], base::Unretained(&run_order)));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
ASSERT_THAT(run_order, ElementsAre(1));
}
@@ -1519,14 +1519,14 @@ TEST_F(TaskQueueManagerTest, UnregisterTaskQueueInNestedLoop) {
FROM_HERE, base::Bind(&PostFromNestedRunloop, message_loop_.get(),
base::RetainedRef(runners_[0]),
base::Unretained(&tasks_to_post_from_nested_loop)));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
// Add a final call to HasOneRefTask. This gives the manager a chance to
// release its reference, and checks that it has.
runners_[0]->PostTask(FROM_HERE,
base::Bind(&HasOneRefTask, base::Unretained(&log),
base::Unretained(task_queue.get())));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_THAT(log, ElementsAre(false, false, true));
}
@@ -1897,7 +1897,7 @@ TEST_F(TaskQueueManagerTest, CurrentlyExecutingTaskQueue_NestedLoop) {
message_loop_.get(), manager_.get(), &task_sources,
&tasks_to_post_from_nested_loop));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
EXPECT_THAT(task_sources, ElementsAre(queue0, queue1, queue2, queue0));
EXPECT_EQ(nullptr, manager_->currently_executing_task_queue());
}
@@ -1958,7 +1958,7 @@ TEST_F(TaskQueueManagerTestWithTracing, BlameContextAttribution) {
blame_context.Initialize();
queue->SetBlameContext(&blame_context);
queue->PostTask(FROM_HERE, base::Bind(&NopTask));
- message_loop_->RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
}
StopTracing();
std::unique_ptr<trace_analyzer::TraceAnalyzer> analyzer =
« no previous file with comments | « components/scheduler/base/task_queue_manager_perftest.cc ('k') | components/scheduler/child/idle_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698