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

Unified Diff: ui/events/gesture_detection/gesture_provider_unittest.cc

Issue 2849603003: Use ScopedTaskEnvironment instead of MessageLoopForUI in ui tests. (Closed)
Patch Set: CR-add-newline-after-include 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: ui/events/gesture_detection/gesture_provider_unittest.cc
diff --git a/ui/events/gesture_detection/gesture_provider_unittest.cc b/ui/events/gesture_detection/gesture_provider_unittest.cc
index 7987d4aa7ff74f151a578fa2a73092c6f7efa82a..215e972608c8e310f3d8a77b859aa726a4637287 100644
--- a/ui/events/gesture_detection/gesture_provider_unittest.cc
+++ b/ui/events/gesture_detection/gesture_provider_unittest.cc
@@ -13,6 +13,7 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -64,7 +65,9 @@ gfx::RectF BoundsForSingleMockTouchAtLocation(float x, float y) {
class GestureProviderTest : public testing::Test, public GestureProviderClient {
public:
- GestureProviderTest() {}
+ GestureProviderTest()
+ : scoped_task_environment_(
+ base::test::ScopedTaskEnvironment::MainThreadType::UI) {}
~GestureProviderTest() override {}
static MockMotionEvent ObtainMotionEvent(base::TimeTicks event_time,
@@ -425,7 +428,7 @@ class GestureProviderTest : public testing::Test, public GestureProviderClient {
std::vector<GestureEventData> gestures_;
std::unique_ptr<GestureProvider> gesture_provider_;
std::unique_ptr<GestureEventData> active_scroll_begin_event_;
- base::MessageLoopForUI message_loop_;
+ base::test::ScopedTaskEnvironment scoped_task_environment_;
};
// Verify that a DOWN followed shortly by an UP will trigger a single tap.

Powered by Google App Engine
This is Rietveld 408576698