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

Unified Diff: ui/events/x/events_x_unittest.cc

Issue 2654653002: Handle floating point coordinates from ozone to exosphere (Closed)
Patch Set: 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/x/events_x.cc ('k') | ui/ozone/platform/wayland/wayland_pointer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/events_x_unittest.cc
diff --git a/ui/events/x/events_x_unittest.cc b/ui/events/x/events_x_unittest.cc
index 409cf82407be6010fdbdaf7b16fa808b9c3b0f36..529e59a39d22cd7894c96d0be13dc35320f277b8 100644
--- a/ui/events/x/events_x_unittest.cc
+++ b/ui/events/x/events_x_unittest.cc
@@ -244,6 +244,8 @@ TEST_F(EventsXTest, TouchEventBasic) {
0, XI_TouchBegin, 5, gfx::Point(10, 10), valuators);
EXPECT_EQ(ui::ET_TOUCH_PRESSED, ui::EventTypeFromNative(scoped_xevent));
EXPECT_EQ("10,10", ui::EventLocationFromNative(scoped_xevent).ToString());
+ EXPECT_EQ(ui::EventLocationFromNative(scoped_xevent),
+ gfx::ToFlooredPoint(ui::EventLocationFromNativeF(scoped_xevent)));
EXPECT_EQ(GetTouchId(scoped_xevent), 0);
EXPECT_FLOAT_EQ(GetTouchAngle(scoped_xevent), 0.15f);
PointerDetails pointer_details =
@@ -259,6 +261,8 @@ TEST_F(EventsXTest, TouchEventBasic) {
0, XI_TouchUpdate, 5, gfx::Point(20, 20), valuators);
EXPECT_EQ(ui::ET_TOUCH_MOVED, ui::EventTypeFromNative(scoped_xevent));
EXPECT_EQ("20,20", ui::EventLocationFromNative(scoped_xevent).ToString());
+ EXPECT_EQ(ui::EventLocationFromNative(scoped_xevent),
+ gfx::ToFlooredPoint(ui::EventLocationFromNativeF(scoped_xevent)));
EXPECT_EQ(GetTouchId(scoped_xevent), 0);
EXPECT_FLOAT_EQ(GetTouchAngle(scoped_xevent), 0.25f);
pointer_details = GetTouchPointerDetailsFromNative(scoped_xevent);
@@ -275,6 +279,8 @@ TEST_F(EventsXTest, TouchEventBasic) {
0, XI_TouchBegin, 6, gfx::Point(200, 200), valuators);
EXPECT_EQ(ui::ET_TOUCH_PRESSED, ui::EventTypeFromNative(scoped_xevent));
EXPECT_EQ("200,200", ui::EventLocationFromNative(scoped_xevent).ToString());
+ EXPECT_EQ(ui::EventLocationFromNative(scoped_xevent),
+ gfx::ToFlooredPoint(ui::EventLocationFromNativeF(scoped_xevent)));
EXPECT_EQ(GetTouchId(scoped_xevent), 1);
EXPECT_FLOAT_EQ(GetTouchAngle(scoped_xevent), 0.45f);
pointer_details = GetTouchPointerDetailsFromNative(scoped_xevent);
@@ -289,6 +295,8 @@ TEST_F(EventsXTest, TouchEventBasic) {
0, XI_TouchEnd, 5, gfx::Point(30, 30), valuators);
EXPECT_EQ(ui::ET_TOUCH_RELEASED, ui::EventTypeFromNative(scoped_xevent));
EXPECT_EQ("30,30", ui::EventLocationFromNative(scoped_xevent).ToString());
+ EXPECT_EQ(ui::EventLocationFromNative(scoped_xevent),
+ gfx::ToFlooredPoint(ui::EventLocationFromNativeF(scoped_xevent)));
EXPECT_EQ(GetTouchId(scoped_xevent), 0);
EXPECT_FLOAT_EQ(GetTouchAngle(scoped_xevent), 0.25f);
pointer_details = GetTouchPointerDetailsFromNative(scoped_xevent);
@@ -303,6 +311,8 @@ TEST_F(EventsXTest, TouchEventBasic) {
0, XI_TouchEnd, 6, gfx::Point(200, 200), valuators);
EXPECT_EQ(ui::ET_TOUCH_RELEASED, ui::EventTypeFromNative(scoped_xevent));
EXPECT_EQ("200,200", ui::EventLocationFromNative(scoped_xevent).ToString());
+ EXPECT_EQ(ui::EventLocationFromNative(scoped_xevent),
+ gfx::ToFlooredPoint(ui::EventLocationFromNativeF(scoped_xevent)));
EXPECT_EQ(GetTouchId(scoped_xevent), 1);
EXPECT_FLOAT_EQ(GetTouchAngle(scoped_xevent), 0.45f);
pointer_details = GetTouchPointerDetailsFromNative(scoped_xevent);
« no previous file with comments | « ui/events/x/events_x.cc ('k') | ui/ozone/platform/wayland/wayland_pointer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698