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

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: Addressed few comments. 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..b70b19c966cb479d32b05970c111c4d174aec457 100644
--- a/content/common/input/input_param_traits_unittest.cc
+++ b/content/common/input/input_param_traits_unittest.cc
@@ -7,6 +7,7 @@
#include "content/common/input/input_event.h"
#include "content/common/input/synthetic_gesture_params.h"
#include "content/common/input/synthetic_pinch_gesture_params.h"
+#include "content/common/input/synthetic_smooth_drag_gesture_params.h"
#include "content/common/input/synthetic_smooth_scroll_gesture_params.h"
#include "content/common/input_messages.h"
#include "ipc/ipc_message.h"
@@ -43,11 +44,21 @@ class InputParamTraitsTest : public testing::Test {
EXPECT_EQ(a->anchor, b->anchor);
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->distances[i], b->distances[i]);
EXPECT_EQ(a->prevent_fling, b->prevent_fling);
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]);
+ 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 +88,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