| Index: content/browser/renderer_host/input/touch_event_queue_unittest.cc
|
| diff --git a/content/browser/renderer_host/input/touch_event_queue_unittest.cc b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
|
| index 4697b491e607b05c2fb0028af1adcaf34abe9403..10aea3e7b1aee5557222bcd6d91886fb548efed8 100644
|
| --- a/content/browser/renderer_host/input/touch_event_queue_unittest.cc
|
| +++ b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
|
| @@ -35,7 +35,6 @@ class TouchEventQueueTest : public testing::Test,
|
| acked_event_count_(0),
|
| last_acked_event_state_(INPUT_EVENT_ACK_STATE_UNKNOWN),
|
| slop_length_dips_(0),
|
| - slop_includes_boundary_(true),
|
| touch_scrolling_mode_(TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT) {}
|
|
|
| virtual ~TouchEventQueueTest() {}
|
| @@ -81,8 +80,6 @@ class TouchEventQueueTest : public testing::Test,
|
| TouchEventQueue::Config config;
|
| config.touch_scrolling_mode = touch_scrolling_mode_;
|
| config.touchmove_slop_suppression_length_dips = slop_length_dips_;
|
| - config.touchmove_slop_suppression_region_includes_boundary =
|
| - slop_includes_boundary_;
|
| return config;
|
| }
|
|
|
| @@ -91,10 +88,8 @@ class TouchEventQueueTest : public testing::Test,
|
| ResetQueueWithConfig(CreateConfig());
|
| }
|
|
|
| - void SetUpForTouchMoveSlopTesting(double slop_length_dips,
|
| - bool slop_includes_boundary) {
|
| + void SetUpForTouchMoveSlopTesting(double slop_length_dips) {
|
| slop_length_dips_ = slop_length_dips;
|
| - slop_includes_boundary_ = slop_includes_boundary;
|
| ResetQueueWithConfig(CreateConfig());
|
| }
|
|
|
| @@ -253,7 +248,6 @@ class TouchEventQueueTest : public testing::Test,
|
| scoped_ptr<WebGestureEvent> followup_gesture_event_;
|
| scoped_ptr<InputEventAckState> sync_ack_result_;
|
| double slop_length_dips_;
|
| - bool slop_includes_boundary_;
|
| TouchEventQueue::TouchScrollingMode touch_scrolling_mode_;
|
| base::MessageLoopForUI message_loop_;
|
| };
|
| @@ -1371,8 +1365,7 @@ TEST_F(TouchEventQueueTest, NoCancelOnTouchTimeoutWithoutConsumer) {
|
| TEST_F(TouchEventQueueTest, TouchMoveSuppressionIncludingSlopBoundary) {
|
| const double kSlopLengthDips = 10.;
|
| const double kHalfSlopLengthDips = kSlopLengthDips / 2;
|
| - const bool slop_includes_boundary = true;
|
| - SetUpForTouchMoveSlopTesting(kSlopLengthDips, slop_includes_boundary);
|
| + SetUpForTouchMoveSlopTesting(kSlopLengthDips);
|
|
|
| // Queue a TouchStart.
|
| PressTouchPoint(0, 0);
|
| @@ -1452,57 +1445,12 @@ TEST_F(TouchEventQueueTest, TouchMoveSuppressionIncludingSlopBoundary) {
|
| EXPECT_EQ(1U, GetAndResetAckedEventCount());
|
| }
|
|
|
| -// Tests that TouchMove's are dropped if within the boundary-exclusive slop
|
| -// suppression region for an unconsumed TouchStart.
|
| -TEST_F(TouchEventQueueTest, TouchMoveSuppressionExcludingSlopBoundary) {
|
| - const double kSlopLengthDips = 10.;
|
| - const double kHalfSlopLengthDips = kSlopLengthDips / 2;
|
| - const bool slop_includes_boundary = false;
|
| - SetUpForTouchMoveSlopTesting(kSlopLengthDips, slop_includes_boundary);
|
| -
|
| - // Queue a TouchStart.
|
| - PressTouchPoint(0, 0);
|
| - SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
|
| - ASSERT_EQ(1U, GetAndResetSentEventCount());
|
| - ASSERT_EQ(1U, GetAndResetAckedEventCount());
|
| -
|
| - // TouchMove's within the region should be suppressed.
|
| - MoveTouchPoint(0, 0, kHalfSlopLengthDips);
|
| - EXPECT_EQ(0U, queued_event_count());
|
| - EXPECT_EQ(0U, GetAndResetSentEventCount());
|
| - EXPECT_EQ(1U, GetAndResetAckedEventCount());
|
| - EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, acked_event_state());
|
| -
|
| - MoveTouchPoint(0, kSlopLengthDips - 0.2f, 0);
|
| - EXPECT_EQ(0U, queued_event_count());
|
| - EXPECT_EQ(0U, GetAndResetSentEventCount());
|
| - EXPECT_EQ(1U, GetAndResetAckedEventCount());
|
| - EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, acked_event_state());
|
| -
|
| - // As soon as a TouchMove reaches the (Euclidean) slop distance, no more
|
| - // TouchMove's should be suppressed.
|
| - MoveTouchPoint(0, kSlopLengthDips, 0);
|
| - EXPECT_EQ(1U, queued_event_count());
|
| - EXPECT_EQ(1U, GetAndResetSentEventCount());
|
| - EXPECT_EQ(0U, GetAndResetAckedEventCount());
|
| - SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
|
| - EXPECT_EQ(1U, GetAndResetAckedEventCount());
|
| -
|
| - MoveTouchPoint(0, kHalfSlopLengthDips, 0);
|
| - EXPECT_EQ(1U, queued_event_count());
|
| - EXPECT_EQ(1U, GetAndResetSentEventCount());
|
| - EXPECT_EQ(0U, GetAndResetAckedEventCount());
|
| - SendTouchEventAck(INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
|
| - EXPECT_EQ(1U, GetAndResetAckedEventCount());
|
| -}
|
| -
|
| // Tests that TouchMove's are not dropped within the slop suppression region if
|
| // the touchstart was consumed.
|
| TEST_F(TouchEventQueueTest, NoTouchMoveSuppressionAfterTouchConsumed) {
|
| const double kSlopLengthDips = 10.;
|
| const double kHalfSlopLengthDips = kSlopLengthDips / 2;
|
| - const bool slop_includes_boundary = true;
|
| - SetUpForTouchMoveSlopTesting(kSlopLengthDips, slop_includes_boundary);
|
| + SetUpForTouchMoveSlopTesting(kSlopLengthDips);
|
|
|
| // Queue a TouchStart.
|
| PressTouchPoint(0, 0);
|
| @@ -1523,9 +1471,7 @@ TEST_F(TouchEventQueueTest, NoTouchMoveSuppressionAfterTouchConsumed) {
|
| TEST_F(TouchEventQueueTest, TouchMoveSuppressionWithDIPScaling) {
|
| const float kSlopLengthPixels = 7.f;
|
| const float kDPIScale = 3.f;
|
| - const bool slop_includes_boundary = true;
|
| - SetUpForTouchMoveSlopTesting(kSlopLengthPixels / kDPIScale,
|
| - slop_includes_boundary);
|
| + SetUpForTouchMoveSlopTesting(kSlopLengthPixels / kDPIScale);
|
|
|
| // Queue a TouchStart.
|
| PressTouchPoint(0, 0);
|
| @@ -1565,8 +1511,7 @@ TEST_F(TouchEventQueueTest, TouchMoveSuppressionWithDIPScaling) {
|
| TEST_F(TouchEventQueueTest, NoTouchMoveSuppressionAfterMultiTouch) {
|
| const double kSlopLengthDips = 10.;
|
| const double kHalfSlopLengthDips = kSlopLengthDips / 2;
|
| - const bool slop_includes_boundary = true;
|
| - SetUpForTouchMoveSlopTesting(kSlopLengthDips, slop_includes_boundary);
|
| + SetUpForTouchMoveSlopTesting(kSlopLengthDips);
|
|
|
| // Queue a TouchStart.
|
| PressTouchPoint(0, 0);
|
|
|