Commit 12592d43 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Parameterize some tests using kCompositorTouchAction

This CL parameterize some tests using this flag. It does 2 things:
1. Move the kCompositorTouchAction flag from content/ to ui/events/blink.
This is because InputHandlerProxy will need to have access to this flag,
and that content/ depends on ui/events/blink.
2. Parameterize necessary tests based on this flag. Tests include:
InputRouterImplTest, TouchActionFilterTest, InputHandlerProxyTest,
TouchActionBrowserTest.

In order to pameterize the InputRouterImplTest, we have to extract a
InputRouterImplTestBase. The reason is that InputRouterImplTest has a
subclass "TouchpadPinchInputRouterImplTest", which is already a
parameterized test depending on another flag.

Bug: 900202
Change-Id: I07e30739ee86aaf8b1840d6e0dccfc504a16b075
Reviewed-on: https://chromium-review.googlesource.com/c/1307833
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarDmitry Gozman <dgozman@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604491}
parent a1b1bcd1
...@@ -111,7 +111,7 @@ class CONTENT_EXPORT InputRouterImpl : public InputRouter, ...@@ -111,7 +111,7 @@ class CONTENT_EXPORT InputRouterImpl : public InputRouter,
void ForceResetTouchActionForTest(); void ForceResetTouchActionForTest();
private: private:
friend class InputRouterImplTest; friend class InputRouterImplTestBase;
friend class MockRenderWidgetHost; friend class MockRenderWidgetHost;
friend class RenderWidgetHostSitePerProcessTest; friend class RenderWidgetHostSitePerProcessTest;
friend class SitePerProcessBrowserTouchActionTest; friend class SitePerProcessBrowserTouchActionTest;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/browser/renderer_host/input/synthetic_gesture.h" #include "content/browser/renderer_host/input/synthetic_gesture.h"
#include "content/browser/renderer_host/input/synthetic_gesture_controller.h" #include "content/browser/renderer_host/input/synthetic_gesture_controller.h"
...@@ -33,6 +34,7 @@ ...@@ -33,6 +34,7 @@
#include "content/public/test/test_utils.h" #include "content/public/test/test_utils.h"
#include "content/shell/browser/shell.h" #include "content/shell/browser/shell.h"
#include "third_party/blink/public/platform/web_input_event.h" #include "third_party/blink/public/platform/web_input_event.h"
#include "ui/events/blink/blink_features.h"
#include "ui/latency/latency_info.h" #include "ui/latency/latency_info.h"
using blink::WebInputEvent; using blink::WebInputEvent;
...@@ -130,10 +132,15 @@ constexpr base::TimeDelta kLongJankTime = ...@@ -130,10 +132,15 @@ constexpr base::TimeDelta kLongJankTime =
namespace content { namespace content {
class TouchActionBrowserTest : public ContentBrowserTest,
class TouchActionBrowserTest : public ContentBrowserTest { public testing::WithParamInterface<bool> {
public: public:
TouchActionBrowserTest() {} TouchActionBrowserTest() {
if (GetParam())
feature_list_.InitAndEnableFeature(features::kCompositorTouchAction);
else
feature_list_.InitAndDisableFeature(features::kCompositorTouchAction);
}
~TouchActionBrowserTest() override {} ~TouchActionBrowserTest() override {}
RenderWidgetHostImpl* GetWidgetHost() { RenderWidgetHostImpl* GetWidgetHost() {
...@@ -428,10 +435,13 @@ class TouchActionBrowserTest : public ContentBrowserTest { ...@@ -428,10 +435,13 @@ class TouchActionBrowserTest : public ContentBrowserTest {
private: private:
std::unique_ptr<RenderFrameSubmissionObserver> frame_observer_; std::unique_ptr<RenderFrameSubmissionObserver> frame_observer_;
std::unique_ptr<base::RunLoop> run_loop_; std::unique_ptr<base::RunLoop> run_loop_;
base::test::ScopedFeatureList feature_list_;
DISALLOW_COPY_AND_ASSIGN(TouchActionBrowserTest); DISALLOW_COPY_AND_ASSIGN(TouchActionBrowserTest);
}; };
INSTANTIATE_TEST_CASE_P(, TouchActionBrowserTest, testing::Bool());
#if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) || \ #if !defined(NDEBUG) || defined(ADDRESS_SANITIZER) || \
defined(MEMORY_SANITIZER) || defined(LEAK_SANITIZER) || \ defined(MEMORY_SANITIZER) || defined(LEAK_SANITIZER) || \
defined(THREAD_SANITIZER) defined(THREAD_SANITIZER)
...@@ -442,7 +452,7 @@ class TouchActionBrowserTest : public ContentBrowserTest { ...@@ -442,7 +452,7 @@ class TouchActionBrowserTest : public ContentBrowserTest {
// //
// Verify the test infrastructure works - we can touch-scroll the page and get a // Verify the test infrastructure works - we can touch-scroll the page and get a
// touchcancel as expected. // touchcancel as expected.
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_DefaultAuto) { IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest, MAYBE_DefaultAuto) {
LoadURL(kTouchActionDataURL); LoadURL(kTouchActionDataURL);
DoTouchScroll(gfx::Point(50, 50), gfx::Vector2d(0, 45), true, 10200, DoTouchScroll(gfx::Point(50, 50), gfx::Vector2d(0, 45), true, 10200,
...@@ -463,7 +473,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_DefaultAuto) { ...@@ -463,7 +473,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_DefaultAuto) {
#else #else
#define MAYBE_TouchActionNone TouchActionNone #define MAYBE_TouchActionNone TouchActionNone
#endif #endif
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_TouchActionNone) { IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest, MAYBE_TouchActionNone) {
LoadURL(kTouchActionDataURL); LoadURL(kTouchActionDataURL);
DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45), false, 10200, DoTouchScroll(gfx::Point(50, 150), gfx::Vector2d(0, 45), false, 10200,
...@@ -482,7 +492,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_TouchActionNone) { ...@@ -482,7 +492,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_TouchActionNone) {
#else #else
#define MAYBE_PanYMainThreadJanky PanYMainThreadJanky #define MAYBE_PanYMainThreadJanky PanYMainThreadJanky
#endif #endif
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanYMainThreadJanky) { IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest, MAYBE_PanYMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
DoTouchScroll(gfx::Point(25, 125), gfx::Vector2d(0, 45), false, 10000, DoTouchScroll(gfx::Point(25, 125), gfx::Vector2d(0, 45), false, 10000,
...@@ -496,7 +506,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanYMainThreadJanky) { ...@@ -496,7 +506,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanYMainThreadJanky) {
#else #else
#define MAYBE_PanXMainThreadJanky PanXMainThreadJanky #define MAYBE_PanXMainThreadJanky PanXMainThreadJanky
#endif #endif
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXMainThreadJanky) { IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest, MAYBE_PanXMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
DoTouchScroll(gfx::Point(125, 25), gfx::Vector2d(45, 0), false, 10000, DoTouchScroll(gfx::Point(125, 25), gfx::Vector2d(45, 0), false, 10000,
...@@ -510,7 +520,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXMainThreadJanky) { ...@@ -510,7 +520,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXMainThreadJanky) {
#endif #endif
// When touch ack timeout is triggered, the panx gesture will be allowed even // When touch ack timeout is triggered, the panx gesture will be allowed even
// though we touch the pany area. // though we touch the pany area.
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXAtYAreaWithTimeout) { IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest, MAYBE_PanXAtYAreaWithTimeout) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
DoTouchScroll(gfx::Point(25, 125), gfx::Vector2d(45, 0), false, 10000, DoTouchScroll(gfx::Point(25, 125), gfx::Vector2d(45, 0), false, 10000,
...@@ -525,7 +535,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXAtYAreaWithTimeout) { ...@@ -525,7 +535,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXAtYAreaWithTimeout) {
#endif #endif
// When touch ack timeout is triggered, the panx gesture will be allowed even // When touch ack timeout is triggered, the panx gesture will be allowed even
// though we touch the pany area. // though we touch the pany area.
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest,
MAYBE_TwoFingerPanXAtYAreaWithTimeout) { MAYBE_TwoFingerPanXAtYAreaWithTimeout) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
...@@ -539,7 +549,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, ...@@ -539,7 +549,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
#else #else
#define MAYBE_PanXYMainThreadJanky PanXYMainThreadJanky #define MAYBE_PanXYMainThreadJanky PanXYMainThreadJanky
#endif #endif
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXYMainThreadJanky) { IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest, MAYBE_PanXYMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
DoTouchScroll(gfx::Point(75, 60), gfx::Vector2d(45, 45), false, 10000, DoTouchScroll(gfx::Point(75, 60), gfx::Vector2d(45, 45), false, 10000,
...@@ -553,7 +563,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXYMainThreadJanky) { ...@@ -553,7 +563,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_PanXYMainThreadJanky) {
#else #else
#define MAYBE_PanXYAtXAreaMainThreadJanky PanXYAtXAreaMainThreadJanky #define MAYBE_PanXYAtXAreaMainThreadJanky PanXYAtXAreaMainThreadJanky
#endif #endif
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest,
MAYBE_PanXYAtXAreaMainThreadJanky) { MAYBE_PanXYAtXAreaMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
...@@ -568,7 +578,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, ...@@ -568,7 +578,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
#else #else
#define MAYBE_PanXYAtYAreaMainThreadJanky PanXYAtYAreaMainThreadJanky #define MAYBE_PanXYAtYAreaMainThreadJanky PanXYAtYAreaMainThreadJanky
#endif #endif
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest,
MAYBE_PanXYAtYAreaMainThreadJanky) { MAYBE_PanXYAtYAreaMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
...@@ -585,7 +595,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, ...@@ -585,7 +595,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
#define MAYBE_PanXYAtAutoYOverlapAreaMainThreadJanky \ #define MAYBE_PanXYAtAutoYOverlapAreaMainThreadJanky \
PanXYAtAutoYOverlapAreaMainThreadJanky PanXYAtAutoYOverlapAreaMainThreadJanky
#endif #endif
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest,
MAYBE_PanXYAtAutoYOverlapAreaMainThreadJanky) { MAYBE_PanXYAtAutoYOverlapAreaMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
...@@ -602,7 +612,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, ...@@ -602,7 +612,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
#define MAYBE_PanXYAtAutoXOverlapAreaMainThreadJanky \ #define MAYBE_PanXYAtAutoXOverlapAreaMainThreadJanky \
PanXYAtAutoXOverlapAreaMainThreadJanky PanXYAtAutoXOverlapAreaMainThreadJanky
#endif #endif
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest,
MAYBE_PanXYAtAutoXOverlapAreaMainThreadJanky) { MAYBE_PanXYAtAutoXOverlapAreaMainThreadJanky) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
...@@ -618,7 +628,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, ...@@ -618,7 +628,7 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest,
#endif #endif
// Test that two finger panning is treated as pinch zoom and is disallowed when // Test that two finger panning is treated as pinch zoom and is disallowed when
// touching the pan-y area. // touching the pan-y area.
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_TwoFingerPanYDisallowed) { IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest, MAYBE_TwoFingerPanYDisallowed) {
LoadURL(kTouchActionURLWithOverlapArea); LoadURL(kTouchActionURLWithOverlapArea);
DoTwoFingerPan(); DoTwoFingerPan();
...@@ -647,7 +657,7 @@ const std::string kDoubleTapZoomDataURL = R"HTML( ...@@ -647,7 +657,7 @@ const std::string kDoubleTapZoomDataURL = R"HTML(
// Test that |touch-action: none| correctly blocks a double-tap and drag zoom // Test that |touch-action: none| correctly blocks a double-tap and drag zoom
// gesture. // gesture.
IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, BlockDoubleTapDragZoom) { IN_PROC_BROWSER_TEST_P(TouchActionBrowserTest, BlockDoubleTapDragZoom) {
LoadURL(kDoubleTapZoomDataURL.c_str()); LoadURL(kDoubleTapZoomDataURL.c_str());
ASSERT_EQ(1, ExecuteScriptAndExtractDouble("window.visualViewport.scale")); ASSERT_EQ(1, ExecuteScriptAndExtractDouble("window.visualViewport.scale"));
......
...@@ -68,7 +68,7 @@ class CONTENT_EXPORT TouchActionFilter { ...@@ -68,7 +68,7 @@ class CONTENT_EXPORT TouchActionFilter {
void AppendToGestureSequenceForDebugging(const char* str); void AppendToGestureSequenceForDebugging(const char* str);
private: private:
friend class InputRouterImplTest; friend class InputRouterImplTestBase;
friend class MockRenderWidgetHost; friend class MockRenderWidgetHost;
friend class TouchActionFilterTest; friend class TouchActionFilterTest;
friend class TouchActionFilterPinchTest; friend class TouchActionFilterPinchTest;
......
...@@ -116,11 +116,6 @@ const base::Feature kCompositeOpaqueFixedPosition{ ...@@ -116,11 +116,6 @@ const base::Feature kCompositeOpaqueFixedPosition{
const base::Feature kCompositeOpaqueScrollers{"CompositeOpaqueScrollers", const base::Feature kCompositeOpaqueScrollers{"CompositeOpaqueScrollers",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enables handling touch events in compositor using impl side touch action
// knowledge.
const base::Feature kCompositorTouchAction{"CompositorTouchAction",
base::FEATURE_DISABLED_BY_DEFAULT};
// Enables crash reporting via Reporting API. // Enables crash reporting via Reporting API.
// https://www.w3.org/TR/reporting/#crash-report // https://www.w3.org/TR/reporting/#crash-report
const base::Feature kCrashReporting{"CrashReporting", const base::Feature kCrashReporting{"CrashReporting",
......
...@@ -36,7 +36,6 @@ CONTENT_EXPORT extern const base::Feature kCacheInlineScriptCode; ...@@ -36,7 +36,6 @@ CONTENT_EXPORT extern const base::Feature kCacheInlineScriptCode;
CONTENT_EXPORT extern const base::Feature kCanvas2DImageChromium; CONTENT_EXPORT extern const base::Feature kCanvas2DImageChromium;
CONTENT_EXPORT extern const base::Feature kCompositeOpaqueFixedPosition; CONTENT_EXPORT extern const base::Feature kCompositeOpaqueFixedPosition;
CONTENT_EXPORT extern const base::Feature kCompositeOpaqueScrollers; CONTENT_EXPORT extern const base::Feature kCompositeOpaqueScrollers;
CONTENT_EXPORT extern const base::Feature kCompositorTouchAction;
CONTENT_EXPORT extern const base::Feature kCrashReporting; CONTENT_EXPORT extern const base::Feature kCrashReporting;
CONTENT_EXPORT extern const base::Feature kCSSFragmentIdentifiers; CONTENT_EXPORT extern const base::Feature kCSSFragmentIdentifiers;
CONTENT_EXPORT extern const base::Feature kDataSaverHoldback; CONTENT_EXPORT extern const base::Feature kDataSaverHoldback;
......
...@@ -1011,6 +1011,7 @@ test("content_browsertests") { ...@@ -1011,6 +1011,7 @@ test("content_browsertests") {
"//ui/compositor", "//ui/compositor",
"//ui/display", "//ui/display",
"//ui/events:test_support", "//ui/events:test_support",
"//ui/events/blink:blink",
"//ui/gfx", "//ui/gfx",
"//ui/gfx/geometry", "//ui/gfx/geometry",
"//ui/gl", "//ui/gl",
......
...@@ -25,4 +25,7 @@ const base::Feature kNoHoverAfterLayoutChange{ ...@@ -25,4 +25,7 @@ const base::Feature kNoHoverAfterLayoutChange{
const base::Feature kNoHoverDuringScroll{"NoHoverDuringScroll", const base::Feature kNoHoverDuringScroll{"NoHoverDuringScroll",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kCompositorTouchAction{"CompositorTouchAction",
base::FEATURE_DISABLED_BY_DEFAULT};
} }
...@@ -35,6 +35,10 @@ extern const base::Feature kNoHoverAfterLayoutChange; ...@@ -35,6 +35,10 @@ extern const base::Feature kNoHoverAfterLayoutChange;
// dispatching mouse enter/exit events for elements under the mouse as the page // dispatching mouse enter/exit events for elements under the mouse as the page
// is scrolled. // is scrolled.
extern const base::Feature kNoHoverDuringScroll; extern const base::Feature kNoHoverDuringScroll;
// Enables handling touch events in compositor using impl side touch action
// knowledge.
extern const base::Feature kCompositorTouchAction;
} }
#endif // UI_EVENTS_BLINK_BLINK_FEATURES_H_ #endif // UI_EVENTS_BLINK_BLINK_FEATURES_H_
...@@ -63,10 +63,21 @@ enum InputHandlerProxyTestType { ...@@ -63,10 +63,21 @@ enum InputHandlerProxyTestType {
ROOT_SCROLL_SYNCHRONOUS_HANDLER, ROOT_SCROLL_SYNCHRONOUS_HANDLER,
CHILD_SCROLL_NORMAL_HANDLER, CHILD_SCROLL_NORMAL_HANDLER,
CHILD_SCROLL_SYNCHRONOUS_HANDLER, CHILD_SCROLL_SYNCHRONOUS_HANDLER,
COMPOSITOR_TOUCH_ACTION_ENABLED_ROOT_NORMAL,
COMPOSITOR_TOUCH_ACTION_ENABLED_ROOT_SYNCHRONOUS,
COMPOSITOR_TOUCH_ACTION_ENABLED_CHILD_NORMAL,
COMPOSITOR_TOUCH_ACTION_ENABLED_CHILD_SYNCHRONOUS,
}; };
static const InputHandlerProxyTestType test_types[] = { static const InputHandlerProxyTestType test_types[] = {
ROOT_SCROLL_NORMAL_HANDLER, ROOT_SCROLL_SYNCHRONOUS_HANDLER, ROOT_SCROLL_NORMAL_HANDLER,
CHILD_SCROLL_NORMAL_HANDLER, CHILD_SCROLL_SYNCHRONOUS_HANDLER}; ROOT_SCROLL_SYNCHRONOUS_HANDLER,
CHILD_SCROLL_NORMAL_HANDLER,
CHILD_SCROLL_SYNCHRONOUS_HANDLER,
COMPOSITOR_TOUCH_ACTION_ENABLED_ROOT_NORMAL,
COMPOSITOR_TOUCH_ACTION_ENABLED_ROOT_SYNCHRONOUS,
COMPOSITOR_TOUCH_ACTION_ENABLED_CHILD_NORMAL,
COMPOSITOR_TOUCH_ACTION_ENABLED_CHILD_SYNCHRONOUS,
};
MATCHER_P(WheelEventsMatch, expected, "") { MATCHER_P(WheelEventsMatch, expected, "") {
return WheelEventsMatch(arg, expected); return WheelEventsMatch(arg, expected);
...@@ -287,11 +298,22 @@ class InputHandlerProxyTest ...@@ -287,11 +298,22 @@ class InputHandlerProxyTest
public testing::WithParamInterface<InputHandlerProxyTestType> { public testing::WithParamInterface<InputHandlerProxyTestType> {
public: public:
InputHandlerProxyTest() InputHandlerProxyTest()
: synchronous_root_scroll_(GetParam() == ROOT_SCROLL_SYNCHRONOUS_HANDLER), : synchronous_root_scroll_(
GetParam() == ROOT_SCROLL_SYNCHRONOUS_HANDLER ||
GetParam() == COMPOSITOR_TOUCH_ACTION_ENABLED_ROOT_SYNCHRONOUS),
install_synchronous_handler_( install_synchronous_handler_(
GetParam() == ROOT_SCROLL_SYNCHRONOUS_HANDLER || GetParam() == ROOT_SCROLL_SYNCHRONOUS_HANDLER ||
GetParam() == CHILD_SCROLL_SYNCHRONOUS_HANDLER), GetParam() == CHILD_SCROLL_SYNCHRONOUS_HANDLER ||
GetParam() == COMPOSITOR_TOUCH_ACTION_ENABLED_ROOT_SYNCHRONOUS ||
GetParam() == COMPOSITOR_TOUCH_ACTION_ENABLED_CHILD_SYNCHRONOUS),
expected_disposition_(InputHandlerProxy::DID_HANDLE) { expected_disposition_(InputHandlerProxy::DID_HANDLE) {
if (GetParam() == COMPOSITOR_TOUCH_ACTION_ENABLED_ROOT_NORMAL ||
GetParam() == COMPOSITOR_TOUCH_ACTION_ENABLED_ROOT_SYNCHRONOUS ||
GetParam() == COMPOSITOR_TOUCH_ACTION_ENABLED_CHILD_NORMAL ||
GetParam() == COMPOSITOR_TOUCH_ACTION_ENABLED_CHILD_SYNCHRONOUS)
feature_list_.InitAndEnableFeature(features::kCompositorTouchAction);
else
feature_list_.InitAndDisableFeature(features::kCompositorTouchAction);
input_handler_.reset( input_handler_.reset(
new TestInputHandlerProxy(&mock_input_handler_, &mock_client_)); new TestInputHandlerProxy(&mock_input_handler_, &mock_client_));
scroll_result_did_scroll_.did_scroll = true; scroll_result_did_scroll_.did_scroll = true;
...@@ -374,6 +396,9 @@ class InputHandlerProxyTest ...@@ -374,6 +396,9 @@ class InputHandlerProxyTest
base::HistogramTester histogram_tester_; base::HistogramTester histogram_tester_;
cc::InputHandlerScrollResult scroll_result_did_scroll_; cc::InputHandlerScrollResult scroll_result_did_scroll_;
cc::InputHandlerScrollResult scroll_result_did_not_scroll_; cc::InputHandlerScrollResult scroll_result_did_not_scroll_;
private:
base::test::ScopedFeatureList feature_list_;
}; };
class InputHandlerProxyEventQueueTest : public testing::Test { class InputHandlerProxyEventQueueTest : public testing::Test {
......
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