Index: content/common/input/input_param_traits_unittest.cc |
diff --git a/content/common/input/input_param_traits_unittest.cc b/content/common/input/input_param_traits_unittest.cc |
index a652472d6aad09dc22861921909b2a9a7e84290d..666b7669cb041ff70fa69aeb6ff29a1734771dee 100644 |
--- a/content/common/input/input_param_traits_unittest.cc |
+++ b/content/common/input/input_param_traits_unittest.cc |
@@ -57,6 +57,7 @@ class InputParamTraitsTest : public testing::Test { |
EXPECT_EQ(a->distances.size(), b->distances.size()); |
for (size_t i = 0; i < a->distances.size(); i++) |
EXPECT_EQ(a->distances[i], b->distances[i]); |
+ EXPECT_EQ(a->velocity, b->velocity); |
EXPECT_EQ(a->prevent_fling, b->prevent_fling); |
EXPECT_EQ(a->speed_in_pixels_s, b->speed_in_pixels_s); |
} |
@@ -265,6 +266,24 @@ TEST_F(InputParamTraitsTest, SyntheticSmoothScrollGestureParams) { |
Verify(packet_in); |
} |
+TEST_F(InputParamTraitsTest, SyntheticSmoothScrollGestureParamsWithVelocity) { |
+ std::unique_ptr<SyntheticSmoothScrollGestureParams> gesture_params( |
+ new SyntheticSmoothScrollGestureParams); |
+ gesture_params->gesture_source_type = SyntheticGestureParams::MOUSE_INPUT; |
+ gesture_params->anchor.SetPoint(234, 345); |
+ gesture_params->distances.push_back(gfx::Vector2d(123, -789)); |
+ gesture_params->distances.push_back(gfx::Vector2d(-78, 43)); |
+ gesture_params->velocity = gfx::Vector2d(-45, 76); |
+ gesture_params->prevent_fling = false; |
+ gesture_params->speed_in_pixels_s = 456; |
+ ASSERT_EQ(SyntheticGestureParams::SMOOTH_SCROLL_GESTURE, |
+ gesture_params->GetGestureType()); |
+ SyntheticGesturePacket packet_in; |
+ packet_in.set_gesture_params(std::move(gesture_params)); |
+ |
+ Verify(packet_in); |
+} |
+ |
TEST_F(InputParamTraitsTest, SyntheticPinchGestureParams) { |
std::unique_ptr<SyntheticPinchGestureParams> gesture_params( |
new SyntheticPinchGestureParams); |