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

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

Issue 2742473002: gpu benchmarking swipe for touchpad
Patch Set: comments addressed. Created 3 years, 9 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 c5c70a3b32fb4368f423807206cef8e075a4e8b0..d146182cde07d25fe760cea0079a9bdf7bfc1198 100644
--- a/content/common/input/input_param_traits_unittest.cc
+++ b/content/common/input/input_param_traits_unittest.cc
@@ -54,6 +54,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);
}
@@ -262,6 +263,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);

Powered by Google App Engine
This is Rietveld 408576698