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

Unified Diff: ui/aura/window_event_dispatcher_unittest.cc

Issue 278843002: Don't kill key events even when it's VKEY_UNKNOWN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 6 years, 7 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/aura/window_targeter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_event_dispatcher_unittest.cc
diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc
index 5f677b90d538a81ff9422e4088be637d281b0d27..9c3a77ec15ac8d33d605fc36c8a93d740c2faa69 100644
--- a/ui/aura/window_event_dispatcher_unittest.cc
+++ b/ui/aura/window_event_dispatcher_unittest.cc
@@ -350,10 +350,26 @@ TEST_F(WindowEventDispatcherTest, IgnoreUnknownKeys) {
EXPECT_FALSE(unknown_event.handled());
EXPECT_EQ(0, handler.num_key_events());
+ handler.Reset();
ui::KeyEvent known_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, false);
DispatchEventUsingWindowDispatcher(&known_event);
EXPECT_TRUE(known_event.handled());
EXPECT_EQ(1, handler.num_key_events());
+
+ handler.Reset();
+ ui::KeyEvent ime_event(ui::ET_KEY_PRESSED, ui::VKEY_UNKNOWN,
+ ui::EF_IME_FABRICATED_KEY, false);
+ DispatchEventUsingWindowDispatcher(&ime_event);
+ EXPECT_TRUE(ime_event.handled());
+ EXPECT_EQ(1, handler.num_key_events());
+
+ handler.Reset();
+ ui::KeyEvent unknown_key_with_char_event(ui::ET_KEY_PRESSED, ui::VKEY_UNKNOWN,
+ 0, false);
+ unknown_key_with_char_event.set_character(0x00e4 /* "รค" */);
+ DispatchEventUsingWindowDispatcher(&unknown_key_with_char_event);
+ EXPECT_TRUE(unknown_key_with_char_event.handled());
+ EXPECT_EQ(1, handler.num_key_events());
}
TEST_F(WindowEventDispatcherTest, NoDelegateWindowReceivesKeyEvents) {
« no previous file with comments | « no previous file | ui/aura/window_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698