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

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

Issue 668943003: ozone: evdev: Drop unmapped key events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | ui/events/ozone/evdev/keyboard_evdev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc
diff --git a/ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc b/ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc
index f78925cd143e02e6e355874c1ef798e1fe995232..aa7d4a5913d4a1e2b9d0e0bfad003aba35ba3cb5 100644
--- a/ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc
+++ b/ui/events/ozone/evdev/key_event_converter_evdev_unittest.cc
@@ -354,3 +354,18 @@ TEST_F(KeyEventConverterEvdevTest, KeyWithLock) {
EXPECT_EQ(ui::VKEY_CAPITAL, event->key_code());
EXPECT_EQ(0, event->flags());
}
+
+TEST_F(KeyEventConverterEvdevTest, UnmappedKeyPress) {
+ ui::MockKeyEventConverterEvdev* dev = device();
+
+ struct input_event mock_kernel_queue[] = {
+ {{0, 0}, EV_KEY, BTN_TOUCH, 1},
+ {{0, 0}, EV_SYN, SYN_REPORT, 0},
+
+ {{0, 0}, EV_KEY, BTN_TOUCH, 0},
+ {{0, 0}, EV_SYN, SYN_REPORT, 0},
+ };
+
+ dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue));
+ EXPECT_EQ(0u, size());
+}
« no previous file with comments | « no previous file | ui/events/ozone/evdev/keyboard_evdev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698