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

Unified Diff: ui/events/event_unittest.cc

Issue 2647253002: Add tangentialPressure and twist properties to PointerEvent on Windows (Closed)
Patch Set: rotation Created 3 years, 11 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/event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event_unittest.cc
diff --git a/ui/events/event_unittest.cc b/ui/events/event_unittest.cc
index 7fe023a144fb0390e40cd8321671578b42c1b367..4e14ed776766cad365e8e47c3e5180cc93becd34 100644
--- a/ui/events/event_unittest.cc
+++ b/ui/events/event_unittest.cc
@@ -680,11 +680,13 @@ TEST(EventTest, PointerDetailsStylus) {
ui::MouseEvent stylus_event(ET_MOUSE_PRESSED, gfx::Point(0, 0),
gfx::Point(0, 0), ui::EventTimeForNow(), 0, 0);
ui::PointerDetails pointer_details(EventPointerType::POINTER_TYPE_PEN,
- /* radius_x */ 0.0f,
- /* radius_y */ 0.0f,
- /* force */ 21.0f,
- /* tilt_x */ 45.0f,
- /* tilt_y */ -45.0f);
+ /* radius_x */ 0.0f,
+ /* radius_y */ 0.0f,
+ /* force */ 21.0f,
+ /* tilt_x */ 45.0f,
+ /* tilt_y */ -45.0f,
+ /* tangential_pressure */ 0.7f,
+ /* twist */ 196);
stylus_event.set_pointer_details(pointer_details);
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
@@ -694,6 +696,8 @@ TEST(EventTest, PointerDetailsStylus) {
EXPECT_EQ(-45.0f, stylus_event.pointer_details().tilt_y);
EXPECT_EQ(0.0f, stylus_event.pointer_details().radius_x);
EXPECT_EQ(0.0f, stylus_event.pointer_details().radius_y);
+ EXPECT_EQ(0.7f, stylus_event.pointer_details().tangential_pressure);
+ EXPECT_EQ(196, stylus_event.pointer_details().twist);
ui::MouseEvent stylus_event_copy(stylus_event);
EXPECT_EQ(stylus_event.pointer_details(),
@@ -717,7 +721,9 @@ TEST(EventTest, PointerDetailsCustomTouch) {
/* radius_y */ 6.0f,
/* force */ 21.0f,
/* tilt_x */ 45.0f,
- /* tilt_y */ -45.0f);
+ /* tilt_y */ -45.0f,
+ /* tangential_pressure */ 0.7f,
+ /* twist */ 196);
touch_event.set_pointer_details(pointer_details);
EXPECT_EQ(EventPointerType::POINTER_TYPE_PEN,
@@ -727,6 +733,8 @@ TEST(EventTest, PointerDetailsCustomTouch) {
EXPECT_EQ(-45.0f, touch_event.pointer_details().tilt_y);
EXPECT_EQ(5.0f, touch_event.pointer_details().radius_x);
EXPECT_EQ(6.0f, touch_event.pointer_details().radius_y);
+ EXPECT_EQ(0.7f, touch_event.pointer_details().tangential_pressure);
+ EXPECT_EQ(196, touch_event.pointer_details().twist);
ui::TouchEvent touch_event_copy(touch_event);
EXPECT_EQ(touch_event.pointer_details(), touch_event_copy.pointer_details());
« no previous file with comments | « ui/events/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698