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

Unified Diff: content/browser/renderer_host/input/input_router_impl_unittest.cc

Issue 2846933002: Use ScopedTaskEnvironment instead of MessageLoopForUI in content tests. (Closed)
Patch Set: self-review Created 3 years, 8 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: content/browser/renderer_host/input/input_router_impl_unittest.cc
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc
index e148fe3fc30695fead24e9567b5573dbad5601f1..255e97b8e7d3c98f438b07303461aefa6991273d 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -20,6 +20,7 @@
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
+#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "content/browser/renderer_host/input/gesture_event_queue.h"
@@ -152,7 +153,9 @@ bool EventListIsSubset(
class InputRouterImplTest : public testing::Test {
public:
InputRouterImplTest(bool raf_aligned_touch = true,
- bool wheel_scroll_latching = true) {
+ bool wheel_scroll_latching = true)
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {
if (raf_aligned_touch && wheel_scroll_latching) {
feature_list_.InitWithFeatures(
{features::kRafAlignedTouchInputEvents,
@@ -460,7 +463,7 @@ class InputRouterImplTest : public testing::Test {
std::unique_ptr<InputRouterImpl> input_router_;
private:
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
SyntheticWebTouchEvent touch_event_;
base::test::ScopedFeatureList feature_list_;

Powered by Google App Engine
This is Rietveld 408576698