Chromium Code Reviews| 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 0dd2b3d1441a68121d0bf827c3f4693f820ce20e..8a7c04c0a4da18ed5d0bdea9612a1724937d6883 100644 |
| --- a/content/common/input/input_param_traits_unittest.cc |
| +++ b/content/common/input/input_param_traits_unittest.cc |
| @@ -75,6 +75,15 @@ class InputParamTraitsTest : public testing::Test { |
| EXPECT_EQ(a->gesture_source_type, b->gesture_source_type); |
| EXPECT_EQ(a->position, b->position); |
| EXPECT_EQ(a->duration_ms, b->duration_ms); |
| + EXPECT_EQ(a->index, b->index); |
| + EXPECT_EQ(a->pointer_action_type, b->pointer_action_type); |
| + } |
| + |
| + static void Compare(const SyntheticPointerActionParams* a, |
| + const SyntheticPointerActionParams* b) { |
| + EXPECT_EQ(a->gesture_source_type, b->gesture_source_type); |
| + EXPECT_EQ(a->position, b->position); |
| + EXPECT_EQ(a->duration_ms, b->duration_ms); |
| } |
| static void Compare(const SyntheticGesturePacket* a, |
| @@ -102,6 +111,10 @@ class InputParamTraitsTest : public testing::Test { |
| Compare(SyntheticTapGestureParams::Cast(a->gesture_params()), |
| SyntheticTapGestureParams::Cast(b->gesture_params())); |
| break; |
| + case SyntheticGestureParams::POINTER_ACTION: |
| + Compare(SyntheticPointerActionParams::Cast(a->gesture_params()), |
| + SyntheticPointerActionParams::Cast(b->gesture_params())); |
| + break; |
| } |
| } |
| @@ -250,5 +263,21 @@ TEST_F(InputParamTraitsTest, SyntheticTapGestureParams) { |
| Verify(packet_in); |
| } |
| +TEST_F(InputParamTraitsTest, SyntheticPointerActionParams) { |
| + scoped_ptr<SyntheticPointerActionParams> gesture_params( |
| + new SyntheticPointerActionParams); |
| + gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; |
| + gesture_params->position.SetPoint(356, 287); |
| + gesture_params->duration_ms = 16; |
|
tdresser
2016/02/18 14:46:34
I don't think duration should be used for anything
lanwei
2016/02/26 18:39:26
Done.
|
| + gesture_params->index = 1; |
| + gesture_params->pointer_action_type = SyntheticGesture::PRESS; |
| + ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, |
| + gesture_params->GetGestureType()); |
| + SyntheticGesturePacket packet_in; |
| + packet_in.set_gesture_params(std::move(gesture_params)); |
| + |
| + Verify(packet_in); |
| +} |
| + |
| } // namespace |
| } // namespace content |