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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/ozone/evdev/keyboard_evdev.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <linux/input.h> 5 #include <linux/input.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 event = dispatched_event(4); 347 event = dispatched_event(4);
348 EXPECT_EQ(ui::ET_KEY_PRESSED, event->type()); 348 EXPECT_EQ(ui::ET_KEY_PRESSED, event->type());
349 EXPECT_EQ(ui::VKEY_CAPITAL, event->key_code()); 349 EXPECT_EQ(ui::VKEY_CAPITAL, event->key_code());
350 EXPECT_EQ(0, event->flags()); 350 EXPECT_EQ(0, event->flags());
351 351
352 event = dispatched_event(5); 352 event = dispatched_event(5);
353 EXPECT_EQ(ui::ET_KEY_RELEASED, event->type()); 353 EXPECT_EQ(ui::ET_KEY_RELEASED, event->type());
354 EXPECT_EQ(ui::VKEY_CAPITAL, event->key_code()); 354 EXPECT_EQ(ui::VKEY_CAPITAL, event->key_code());
355 EXPECT_EQ(0, event->flags()); 355 EXPECT_EQ(0, event->flags());
356 } 356 }
357
358 TEST_F(KeyEventConverterEvdevTest, UnmappedKeyPress) {
359 ui::MockKeyEventConverterEvdev* dev = device();
360
361 struct input_event mock_kernel_queue[] = {
362 {{0, 0}, EV_KEY, BTN_TOUCH, 1},
363 {{0, 0}, EV_SYN, SYN_REPORT, 0},
364
365 {{0, 0}, EV_KEY, BTN_TOUCH, 0},
366 {{0, 0}, EV_SYN, SYN_REPORT, 0},
367 };
368
369 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue));
370 EXPECT_EQ(0u, size());
371 }
OLDNEW
« 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