| Index: ui/aura/gestures/gesture_recognizer_unittest.cc
|
| diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
|
| index 231e41db5bf37d7a32282560bd36ca3526d56416..dbe59190b604af317303e4dbde8a761775fd05ce 100644
|
| --- a/ui/aura/gestures/gesture_recognizer_unittest.cc
|
| +++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
|
| @@ -5,6 +5,7 @@
|
| #include "base/timer.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "ui/aura/event.h"
|
| +#include "ui/aura/gestures/gesture_configuration.h"
|
| #include "ui/aura/gestures/gesture_recognizer_aura.h"
|
| #include "ui/aura/gestures/gesture_sequence.h"
|
| #include "ui/aura/root_window.h"
|
| @@ -316,8 +317,6 @@ void SendScrollEvent(RootWindow* root_window,
|
| root_window->DispatchTouchEvent(&move);
|
| }
|
|
|
| -const int kBufferedPoints = 10;
|
| -
|
| } // namespace
|
|
|
| typedef AuraTestBase GestureRecognizerTest;
|
| @@ -454,7 +453,9 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) {
|
|
|
| // Get a high x velocity, while still staying on the rail
|
| SendScrollEvents(root_window(), 1, 1, press.time_stamp(),
|
| - 100, 10, kTouchId, 1, kBufferedPoints, delegate.get());
|
| + 100, 10, kTouchId, 1,
|
| + GestureConfiguration::points_buffered_for_velocity(),
|
| + delegate.get());
|
|
|
| delegate->Reset();
|
| TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId);
|
| @@ -486,7 +487,9 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) {
|
|
|
| // Get a high y velocity, while still staying on the rail
|
| SendScrollEvents(root_window(), 1, 1, press.time_stamp(),
|
| - 10, 100, kTouchId, 1, kBufferedPoints, delegate.get());
|
| + 10, 100, kTouchId, 1,
|
| + GestureConfiguration::points_buffered_for_velocity(),
|
| + delegate.get());
|
|
|
| delegate->Reset();
|
| TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId);
|
| @@ -516,7 +519,9 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) {
|
| EXPECT_EQ(20, delegate->scroll_x());
|
|
|
| SendScrollEvents(root_window(), 1, 1, press.time_stamp(),
|
| - 10, 100, kTouchId, 1, kBufferedPoints, delegate.get());
|
| + 10, 100, kTouchId, 1,
|
| + GestureConfiguration::points_buffered_for_velocity(),
|
| + delegate.get());
|
|
|
| delegate->Reset();
|
| TouchEvent release(ui::ET_TOUCH_RELEASED, gfx::Point(101, 201), kTouchId);
|
| @@ -681,7 +686,9 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailScroll) {
|
| // Send enough information that a velocity can be calculated for the gesture,
|
| // and we can break the rail
|
| SendScrollEvents(root_window(), 1, 1, press.time_stamp(),
|
| - 1, 100, kTouchId, 1, kBufferedPoints, delegate.get());
|
| + 1, 100, kTouchId, 1,
|
| + GestureConfiguration::points_buffered_for_velocity(),
|
| + delegate.get());
|
|
|
| SendScrollEvent(root_window(), 0, 0, kTouchId, delegate.get());
|
| SendScrollEvent(root_window(), 5, 5, kTouchId, delegate.get());
|
| @@ -720,7 +727,9 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailScroll) {
|
| // Send enough information that a velocity can be calculated for the gesture,
|
| // and we can break the rail
|
| SendScrollEvents(root_window(), 1, 1, press.time_stamp(),
|
| - 100, 1, kTouchId, 1, kBufferedPoints, delegate.get());
|
| + 100, 1, kTouchId, 1,
|
| + GestureConfiguration::points_buffered_for_velocity(),
|
| + delegate.get());
|
|
|
| SendScrollEvent(root_window(), 0, 0, kTouchId, delegate.get());
|
| SendScrollEvent(root_window(), 5, 5, kTouchId, delegate.get());
|
| @@ -1247,11 +1256,15 @@ TEST_F(GestureRecognizerTest, GestureEventPinchScrollOnlyWhenBothFingersMove) {
|
| root_window()->DispatchTouchEvent(&press2);
|
|
|
| SendScrollEvents(root_window(), 100, 100, press1.time_stamp(),
|
| - 1, 10, kTouchId1, 1, kBufferedPoints, delegate.get());
|
| + 1, 10, kTouchId1, 1,
|
| + GestureConfiguration::points_buffered_for_velocity(),
|
| + delegate.get());
|
|
|
| SendScrollEvents(root_window(), 110, 110, press1.time_stamp() +
|
| base::TimeDelta::FromMilliseconds(1000),
|
| - 1, 10, kTouchId2, 1, kBufferedPoints, delegate.get());
|
| + 1, 10, kTouchId2, 1,
|
| + GestureConfiguration::points_buffered_for_velocity(),
|
| + delegate.get());
|
| // At no point were both fingers moving at the same time,
|
| // so no scrolling should have occurred
|
|
|
|
|