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..302bd50aabfc192bdf1c44f070a67804e292bd32 100644 |
--- a/content/common/input/input_param_traits_unittest.cc |
+++ b/content/common/input/input_param_traits_unittest.cc |
@@ -77,6 +77,14 @@ class InputParamTraitsTest : public testing::Test { |
EXPECT_EQ(a->duration_ms, b->duration_ms); |
} |
+ 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->index(), b->index()); |
+ EXPECT_EQ(a->pointer_action_type, b->pointer_action_type); |
+ } |
+ |
static void Compare(const SyntheticGesturePacket* a, |
const SyntheticGesturePacket* b) { |
ASSERT_EQ(!!a, !!b); |
@@ -102,6 +110,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 +262,19 @@ TEST_F(InputParamTraitsTest, SyntheticTapGestureParams) { |
Verify(packet_in); |
} |
+TEST_F(InputParamTraitsTest, SyntheticPointerActionParams) { |
+ scoped_ptr<SyntheticPointerActionParams> gesture_params( |
+ new SyntheticPointerActionParams( |
+ SyntheticGestureParams::PointerActionType::MOVE)); |
+ gesture_params->gesture_source_type = SyntheticGestureParams::TOUCH_INPUT; |
+ gesture_params->set_position(gfx::PointF(356, 287)); |
+ gesture_params->set_index(1); |
+ 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 |