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

Unified Diff: ui/base/test/ui_controls_mac.mm

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
« no previous file with comments | « ui/base/test/scoped_fake_nswindow_fullscreen.mm ('k') | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/test/ui_controls_mac.mm
diff --git a/ui/base/test/ui_controls_mac.mm b/ui/base/test/ui_controls_mac.mm
index 46db392efc6024adaed2c1475dc1eff6fc82dbd7..c0af6900d0c099e284bf9ac4cc6a991e86d25951 100644
--- a/ui/base/test/ui_controls_mac.mm
+++ b/ui/base/test/ui_controls_mac.mm
@@ -12,6 +12,7 @@
#import "base/mac/foundation_util.h"
#import "base/mac/scoped_objc_class_swizzler.h"
#include "base/message_loop/message_loop.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "ui/base/cocoa/cocoa_base_utils.h"
#include "ui/events/keycodes/keyboard_code_conversion_mac.h"
#import "ui/events/test/cocoa_test_event_utils.h"
@@ -139,11 +140,10 @@ void EventQueueWatcher(const base::Closure& task) {
dequeue:NO];
// If there is still event in the queue, then we need to check again.
if (event) {
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&EventQueueWatcher, task));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&EventQueueWatcher, task));
} else {
- base::MessageLoop::current()->PostTask(FROM_HERE, task);
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, task);
}
}
@@ -282,7 +282,7 @@ bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
[[NSApplication sharedApplication] sendEvent:*iter];
if (!task.is_null()) {
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&EventQueueWatcher, task));
}
@@ -331,7 +331,7 @@ bool SendMouseMoveNotifyWhenDone(long x, long y, const base::Closure& task) {
[[NSApplication sharedApplication] postEvent:event atStart:NO];
if (!task.is_null()) {
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&EventQueueWatcher, task));
}
@@ -395,7 +395,7 @@ bool SendMouseEventsNotifyWhenDone(MouseButton type, int state,
[[NSApplication sharedApplication] postEvent:event atStart:NO];
if (!task.is_null()) {
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&EventQueueWatcher, task));
}
@@ -408,7 +408,7 @@ bool SendMouseClick(MouseButton type) {
}
void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) {
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&EventQueueWatcher, closure));
}
« no previous file with comments | « ui/base/test/scoped_fake_nswindow_fullscreen.mm ('k') | ui/views/widget/native_widget_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698