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

Unified Diff: base/message_loop/message_loop_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: base/message_loop/message_loop_unittest.cc
diff --git a/base/message_loop/message_loop_unittest.cc b/base/message_loop/message_loop_unittest.cc
index 52337e31a8c3ea2f916d0d92302459bf3e43636c..70b3f8ba50937142097d22c78659795eb65fbd41 100644
--- a/base/message_loop/message_loop_unittest.cc
+++ b/base/message_loop/message_loop_unittest.cc
@@ -18,7 +18,6 @@
#include "base/pending_task.h"
#include "base/posix/eintr_wrapper.h"
#include "base/run_loop.h"
-#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/test_simple_task_runner.h"
#include "base/threading/platform_thread.h"
@@ -260,7 +259,7 @@ void RecursiveFunc(TaskList* order, int cookie, int depth,
if (depth > 0) {
if (is_reentrant)
MessageLoop::current()->SetNestableTasksAllowed(true);
- MessageLoop::current()->PostTask(
+ ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
Bind(&RecursiveFunc, order, cookie, depth - 1, is_reentrant));
}
@@ -861,8 +860,10 @@ TEST(MessageLoopTest, IsType) {
void EmptyFunction() {}
void PostMultipleTasks() {
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&EmptyFunction));
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&EmptyFunction));
+ ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(&EmptyFunction));
+ ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(&EmptyFunction));
}
static const int kSignalMsg = WM_USER + 2;
@@ -890,19 +891,20 @@ LRESULT CALLBACK TestWndProcThunk(HWND hwnd, UINT message,
// First, we post a task that will post multiple no-op tasks to make sure
// that the pump's incoming task queue does not become empty during the
// test.
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&PostMultipleTasks));
+ ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(&PostMultipleTasks));
// Next, we post a task that posts a windows message to trigger the second
// stage of the test.
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(&PostWindowsMessage, hwnd));
+ ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&PostWindowsMessage, hwnd));
break;
case 2:
// Since we're about to enter a modal loop, tell the message loop that we
// intend to nest tasks.
MessageLoop::current()->SetNestableTasksAllowed(true);
bool did_run = false;
- MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(&EndTest, &did_run, hwnd));
+ ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&EndTest, &did_run, hwnd));
// Run a nested windows-style message loop and verify that our task runs. If
// it doesn't, then we'll loop here until the test times out.
MSG msg;
« no previous file with comments | « base/message_loop/message_loop_task_runner_unittest.cc ('k') | base/message_loop/message_pump_glib_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698