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 f5dc54c3c900332216669d1cca9e096f7b865eae..9066c7126320a744fcb2d1819cb081b6ee8b3c1a 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()); |
} |
@@ -257,7 +252,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_; |
}; |
@@ -1375,8 +1369,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); |
@@ -1456,57 +1449,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); |
@@ -1543,9 +1491,7 @@ TEST_F(TouchEventQueueTest, NoTouchMoveSuppressionIfDisabled) { |
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); |
@@ -1585,8 +1531,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); |