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

Unified Diff: ui/events/platform/platform_event_source_unittest.cc

Issue 2086093003: Remove calls to deprecated MessageLoop methods in ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: ui/events/platform/platform_event_source_unittest.cc
diff --git a/ui/events/platform/platform_event_source_unittest.cc b/ui/events/platform/platform_event_source_unittest.cc
index d28202932dae84183f84a307aa28ac85930dd33a..45384a83583a5797bba8704e9caf4b48ac83154a 100644
--- a/ui/events/platform/platform_event_source_unittest.cc
+++ b/ui/events/platform/platform_event_source_unittest.cc
@@ -15,6 +15,7 @@
#include "base/memory/scoped_vector.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/platform/platform_event_dispatcher.h"
#include "ui/events/platform/platform_event_observer.h"
@@ -498,10 +499,9 @@ class PlatformEventTestWithMessageLoop : public PlatformEventTest {
~PlatformEventTestWithMessageLoop() override {}
void Run() {
- message_loop_.PostTask(
- FROM_HERE,
- base::Bind(&PlatformEventTestWithMessageLoop::RunTest,
- base::Unretained(this)));
+ message_loop_.task_runner()->PostTask(
+ FROM_HERE, base::Bind(&PlatformEventTestWithMessageLoop::RunTest,
+ base::Unretained(this)));
message_loop_.Run();
}
@@ -657,13 +657,12 @@ class DestroyedNestedOverriddenDispatcherQuitsNestedLoopIteration
base::RunLoop run_loop;
base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
- loop->PostTask(
+ loop->task_runner()->PostTask(
FROM_HERE,
base::Bind(
&DestroyedNestedOverriddenDispatcherQuitsNestedLoopIteration::
NestedTask,
- base::Unretained(this),
- base::Unretained(&list),
+ base::Unretained(this), base::Unretained(&list),
base::Unretained(&overriding)));
run_loop.Run();
@@ -720,11 +719,10 @@ class ConsecutiveOverriddenDispatcherInTheSameMessageLoopIteration
second_overriding.set_callback(run_loop.QuitClosure());
base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
- loop->PostTask(
+ loop->task_runner()->PostTask(
FROM_HERE,
base::Bind(base::IgnoreResult(&TestPlatformEventSource::Dispatch),
- base::Unretained(source()),
- *event));
+ base::Unretained(source()), *event));
run_loop.Run();
ASSERT_EQ(2u, list->size());
EXPECT_EQ(15, (*list)[0]);
@@ -759,13 +757,12 @@ class ConsecutiveOverriddenDispatcherInTheSameMessageLoopIteration
base::RunLoop run_loop;
base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
- loop->PostTask(
+ loop->task_runner()->PostTask(
FROM_HERE,
base::Bind(
&ConsecutiveOverriddenDispatcherInTheSameMessageLoopIteration::
NestedTask,
- base::Unretained(this),
- base::Passed(&override_handle),
+ base::Unretained(this), base::Passed(&override_handle),
base::Unretained(&list)));
run_loop.Run();
« no previous file with comments | « ui/events/gesture_detection/gesture_provider_unittest.cc ('k') | ui/gfx/animation/animation_container_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698