Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1243)

Unified Diff: content/common/input/input_param_traits_unittest.cc

Issue 1707943002: Add SyntheticPointerActionParams used in Chromedriver extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8e84fb16e7eb42a40409a13c40a72d1655f2cd31 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,20 @@ 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->index = 1;
+ gesture_params->pointer_action_type = SyntheticGestureParams::MOVE;
+ 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

Powered by Google App Engine
This is Rietveld 408576698