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

Unified Diff: ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc

Issue 1294523004: ozone: Handle pressure and tilt for stylus devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-pe-details
Patch Set: Drop now unused mutators. Created 5 years, 4 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 | « ui/events/ozone/evdev/tablet_event_converter_evdev.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc
diff --git a/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc
index fc0d974cc77833f6e72ed63e7c5945d7290f758d..4659796ce21a51e946fe9963a49d07d6949189b2 100644
--- a/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc
+++ b/ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc
@@ -421,11 +421,21 @@ TEST_F(TabletEventConverterEvdevTest, Tap) {
ui::MouseEvent* event = dispatched_event(0);
EXPECT_EQ(ui::ET_MOUSE_MOVED, event->type());
+ EXPECT_EQ(ui::EventPointerType::POINTER_TYPE_PEN,
+ event->pointer_details().pointer_type());
+ EXPECT_FLOAT_EQ((90.0f * 68) / 127, event->pointer_details().tilt_x());
+ EXPECT_FLOAT_EQ((90.0f * 64) / 127, event->pointer_details().tilt_y());
event = dispatched_event(1);
EXPECT_EQ(ui::ET_MOUSE_PRESSED, event->type());
+ EXPECT_EQ(ui::EventPointerType::POINTER_TYPE_PEN,
+ event->pointer_details().pointer_type());
+ EXPECT_FLOAT_EQ((float)992 / 2047, event->pointer_details().force());
EXPECT_EQ(true, event->IsLeftMouseButton());
event = dispatched_event(2);
+ EXPECT_EQ(ui::EventPointerType::POINTER_TYPE_PEN,
+ event->pointer_details().pointer_type());
EXPECT_EQ(ui::ET_MOUSE_RELEASED, event->type());
+ EXPECT_FLOAT_EQ(0.0f, event->pointer_details().force());
EXPECT_EQ(true, event->IsLeftMouseButton());
}
« no previous file with comments | « ui/events/ozone/evdev/tablet_event_converter_evdev.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698