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

Unified Diff: components/mus/common/event_param_traits_unittest.cc

Issue 1800633002: IPC::ParamTraits for ui::PointerEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « components/mus/common/event_param_traits_macros.h ('k') | ui/events/event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/common/event_param_traits_unittest.cc
diff --git a/components/mus/common/event_param_traits_unittest.cc b/components/mus/common/event_param_traits_unittest.cc
index d093ed328b36e64a317f5ae184979ee9a7732f62..7c4c8316b7e49f318ffed265b6b2b3f534fd7869 100644
--- a/components/mus/common/event_param_traits_unittest.cc
+++ b/components/mus/common/event_param_traits_unittest.cc
@@ -61,6 +61,14 @@ class EventParamTraitsTest : public testing::Test {
case EventType::ET_DROP_TARGET_EVENT:
Compare(CAST_EVENT(TouchEvent, a), CAST_EVENT(TouchEvent, b));
break;
+ case EventType::ET_POINTER_DOWN:
+ case EventType::ET_POINTER_MOVED:
+ case EventType::ET_POINTER_UP:
+ case EventType::ET_POINTER_CANCELLED:
+ case EventType::ET_POINTER_ENTERED:
+ case EventType::ET_POINTER_EXITED:
+ Compare(CAST_EVENT(PointerEvent, a), CAST_EVENT(PointerEvent, b));
+ break;
case EventType::ET_GESTURE_SCROLL_BEGIN:
case EventType::ET_GESTURE_SCROLL_END:
case EventType::ET_GESTURE_SCROLL_UPDATE:
@@ -452,6 +460,26 @@ TEST_F(EventParamTraitsTest, GoodCornerCaseGestureEvent) {
}
}
+TEST_F(EventParamTraitsTest, GoodSimplePointerEvent) {
+ EventType event_types[] = {
+ ET_POINTER_DOWN, ET_POINTER_MOVED, ET_POINTER_UP,
+ ET_POINTER_CANCELLED, ET_POINTER_ENTERED, ET_POINTER_EXITED,
+ };
+ EventPointerType pointer_types[] = {
+ EventPointerType::POINTER_TYPE_MOUSE,
+ EventPointerType::POINTER_TYPE_TOUCH,
+ };
+
+ for (size_t i = 0; i < arraysize(event_types); i++) {
+ for (size_t j = 0; j < arraysize(pointer_types); j++) {
+ ScopedEvent event(new PointerEvent(event_types[i], pointer_types[j],
+ gfx::Point(), gfx::Point(), 0, 0,
+ base::TimeDelta()));
+ Verify(event);
+ }
+ }
+}
+
#undef FEQ
#undef ASSERT_FEQ
#undef CAST_EVENT
« no previous file with comments | « components/mus/common/event_param_traits_macros.h ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698