Commit 590e8d0c authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Backport some tests in /ui/events/gesture_detection to SingleThreadTaskEnvironment

These tests were previously migrated from single-threaded MessageLoop to
a multi-threaded TaskEnvironment (then named ScopedTaskEnvironment) as
part of crbug.com/891670.

//base OWNERS decided in retrospect that it was better to keep a
single-threaded option for TaskEnvironment and introduced
SingleThreadTaskEnvironment. This CL retrofits that decision for
/ui/events/gesture_detection.

This CL is a no-op if it passes CQ.

This CL was uploaded by git cl split.

R=nzolghadr@chromium.org

Bug: 891670
Change-Id: I3f1e76a565e3cbecb3b5f34e8cb96620fa68df27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787075
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Timothy Dresser <tdresser@chromium.org>
Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695154}
parent c650bce8
...@@ -14,7 +14,8 @@ class FilteredGestureProviderTest : public GestureProviderClient, ...@@ -14,7 +14,8 @@ class FilteredGestureProviderTest : public GestureProviderClient,
public testing::Test { public testing::Test {
public: public:
FilteredGestureProviderTest() FilteredGestureProviderTest()
: task_environment_(base::test::TaskEnvironment::MainThreadType::UI) {} : task_environment_(
base::test::SingleThreadTaskEnvironment::MainThreadType::UI) {}
~FilteredGestureProviderTest() override {} ~FilteredGestureProviderTest() override {}
// GestureProviderClient implementation. // GestureProviderClient implementation.
...@@ -22,7 +23,7 @@ class FilteredGestureProviderTest : public GestureProviderClient, ...@@ -22,7 +23,7 @@ class FilteredGestureProviderTest : public GestureProviderClient,
bool RequiresDoubleTapGestureEvents() const override { return false; } bool RequiresDoubleTapGestureEvents() const override { return false; }
private: private:
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
}; };
// Single touch drag test: After touch-start, the moved_beyond_slop_region bit // Single touch drag test: After touch-start, the moved_beyond_slop_region bit
......
...@@ -66,7 +66,8 @@ gfx::RectF BoundsForSingleMockTouchAtLocation(float x, float y) { ...@@ -66,7 +66,8 @@ gfx::RectF BoundsForSingleMockTouchAtLocation(float x, float y) {
class GestureProviderTest : public testing::Test, public GestureProviderClient { class GestureProviderTest : public testing::Test, public GestureProviderClient {
public: public:
GestureProviderTest() GestureProviderTest()
: task_environment_(base::test::TaskEnvironment::MainThreadType::UI) {} : task_environment_(
base::test::SingleThreadTaskEnvironment::MainThreadType::UI) {}
~GestureProviderTest() override {} ~GestureProviderTest() override {}
static MockMotionEvent ObtainMotionEvent(base::TimeTicks event_time, static MockMotionEvent ObtainMotionEvent(base::TimeTicks event_time,
...@@ -437,7 +438,7 @@ class GestureProviderTest : public testing::Test, public GestureProviderClient { ...@@ -437,7 +438,7 @@ class GestureProviderTest : public testing::Test, public GestureProviderClient {
std::vector<GestureEventData> gestures_; std::vector<GestureEventData> gestures_;
std::unique_ptr<GestureProvider> gesture_provider_; std::unique_ptr<GestureProvider> gesture_provider_;
std::unique_ptr<GestureEventData> active_scroll_begin_event_; std::unique_ptr<GestureEventData> active_scroll_begin_event_;
base::test::TaskEnvironment task_environment_; base::test::SingleThreadTaskEnvironment task_environment_;
bool should_process_double_tap_events_ = true; bool should_process_double_tap_events_ = true;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment