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

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

Issue 2263693003: Add palm suppression feature to EventConverterEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stylus
Patch Set: fixed unit tests Created 4 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/touch_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/touch_event_converter_evdev_unittest.cc
diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
index 39cc35096787bed17751fa68669b6ae1eba710ff..24e16dc545611624e7cff50bac1609fadbea957a 100644
--- a/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
+++ b/ui/events/ozone/evdev/touch_event_converter_evdev_unittest.cc
@@ -609,7 +609,7 @@ TEST_F(TouchEventConverterEvdevTest, ShouldReleaseContactsOnStop) {
EXPECT_EQ(2u, size());
ui::TouchEventParams ev2 = dispatched_touch_event(1);
- EXPECT_EQ(ET_TOUCH_RELEASED, ev2.type);
+ EXPECT_EQ(ET_TOUCH_CANCELLED, ev2.type);
EXPECT_EQ(0, ev2.slot);
}
@@ -654,7 +654,7 @@ TEST_F(TouchEventConverterEvdevTest, ShouldRemoveContactsWhenDisabled) {
EXPECT_EQ(2u, size());
ui::TouchEventParams ev2 = dispatched_touch_event(1);
- EXPECT_EQ(ET_TOUCH_RELEASED, ev2.type);
+ EXPECT_EQ(ET_TOUCH_CANCELLED, ev2.type);
EXPECT_EQ(0, ev2.slot);
// Set up the previous contact in slot 0.
@@ -664,16 +664,16 @@ TEST_F(TouchEventConverterEvdevTest, ShouldRemoveContactsWhenDisabled) {
devinfo.SetAbsMtSlot(ABS_MT_POSITION_Y, 0, 749);
devinfo.SetAbsMtSlot(ABS_MT_PRESSURE, 0, 50);
- // Re-enable the device (should re-apply the contact).
+ // Re-enable the device (touch is cancelled, should not come back)
dev->SimulateReinitialize(devinfo);
dev->SetEnabled(true);
- EXPECT_EQ(3u, size());
+ EXPECT_EQ(2u, size());
- ui::TouchEventParams ev3 = dispatched_touch_event(2);
- EXPECT_EQ(ET_TOUCH_PRESSED, ev3.type);
- EXPECT_EQ(0, ev3.slot);
- EXPECT_EQ(1003, ev3.location.x());
- EXPECT_EQ(749, ev3.location.y());
+ // Send updates to touch (touch is cancelled, should not come back)
+ dev->ConfigureReadMock(mock_kernel_queue_press,
+ arraysize(mock_kernel_queue_press), 0);
+ dev->ReadNow();
+ EXPECT_EQ(2u, size());
}
// crbug.com/477695
« no previous file with comments | « ui/events/ozone/evdev/touch_event_converter_evdev.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698