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

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

Issue 929333002: Adding synthetic touch/mouse drag [Part1] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More nits Created 5 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 cbfd9aa2bcca7dc5269d498b3d42bc139618d74f..6cce1054419faf84ffe8fe1d868ff9f39a585c22 100644
--- a/content/common/input/input_param_traits_unittest.cc
+++ b/content/common/input/input_param_traits_unittest.cc
@@ -48,6 +48,16 @@ class InputParamTraitsTest : public testing::Test {
EXPECT_EQ(a->speed_in_pixels_s, b->speed_in_pixels_s);
}
+ static void Compare(const SyntheticSmoothDragGestureParams* a,
+ const SyntheticSmoothDragGestureParams* b) {
+ EXPECT_EQ(a->gesture_source_type, b->gesture_source_type);
+ EXPECT_EQ(a->start_point, b->start_point);
+ 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]);
Sami 2015/02/19 11:59:06 nit: indent -= 2
ssid 2015/02/20 10:58:55 Changed the previous function also.
+ EXPECT_EQ(a->speed_in_pixels_s, b->speed_in_pixels_s);
+ }
+
static void Compare(const SyntheticPinchGestureParams* a,
const SyntheticPinchGestureParams* b) {
EXPECT_EQ(a->gesture_source_type, b->gesture_source_type);
@@ -77,6 +87,10 @@ class InputParamTraitsTest : public testing::Test {
Compare(SyntheticSmoothScrollGestureParams::Cast(a->gesture_params()),
SyntheticSmoothScrollGestureParams::Cast(b->gesture_params()));
break;
+ case SyntheticGestureParams::SMOOTH_DRAG_GESTURE:
+ Compare(SyntheticSmoothDragGestureParams::Cast(a->gesture_params()),
+ SyntheticSmoothDragGestureParams::Cast(b->gesture_params()));
+ break;
case SyntheticGestureParams::PINCH_GESTURE:
Compare(SyntheticPinchGestureParams::Cast(a->gesture_params()),
SyntheticPinchGestureParams::Cast(b->gesture_params()));

Powered by Google App Engine
This is Rietveld 408576698