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

Side by Side Diff: ui/base/ime/input_method_chromeos_unittest.cc

Issue 1786483002: Add DomKey&DomCode to fabricated keydown event if exists (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test Created 4 years, 9 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
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 "ui/base/ime/input_method_chromeos.h" 5 #include "ui/base/ime/input_method_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #undef Bool 10 #undef Bool
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 // Do key event with event not being stopped propagation. 944 // Do key event with event not being stopped propagation.
945 stop_propagation_post_ime_ = false; 945 stop_propagation_post_ime_ = false;
946 ime_->DispatchKeyEvent(&eventA); 946 ime_->DispatchKeyEvent(&eventA);
947 mock_ime_engine_handler_->last_passed_callback().Run(false); 947 mock_ime_engine_handler_->last_passed_callback().Run(false);
948 948
949 key_event = mock_ime_engine_handler_->last_processed_key_event(); 949 key_event = mock_ime_engine_handler_->last_processed_key_event();
950 EXPECT_EQ(ui::VKEY_A, key_event->key_code()); 950 EXPECT_EQ(ui::VKEY_A, key_event->key_code());
951 EXPECT_EQ(L'A', inserted_char_); 951 EXPECT_EQ(L'A', inserted_char_);
952 } 952 }
953 953
954 TEST_F(InputMethodChromeOSKeyEventTest, DeadKeyPressTest) {
955 // Preparation.
956 input_type_ = TEXT_INPUT_TYPE_TEXT;
957 ime_->OnTextInputTypeChanged(this);
958
959 ui::KeyEvent eventA(ET_KEY_PRESSED,
960 VKEY_OEM_4, // '['
961 DomCode::BRACKET_LEFT,
962 0,
963 DomKey::DeadKeyFromCombiningCharacter('^'),
964 EventTimeForNow());
965 ime_->ProcessKeyEventPostIME(&eventA, true);
966
967 const ui::KeyEvent& key_event = dispatched_key_event_;
968
969 EXPECT_EQ(ET_KEY_PRESSED, key_event.type());
970 EXPECT_EQ(VKEY_PROCESSKEY, key_event.key_code());
971 EXPECT_EQ(eventA.code(), key_event.code());
972 EXPECT_EQ(eventA.flags(), key_event.flags());
973 EXPECT_EQ(eventA.GetDomKey(), key_event.GetDomKey());
974 EXPECT_EQ(eventA.time_stamp(), key_event.time_stamp());
975 }
976
954 } // namespace ui 977 } // namespace ui
OLDNEW
« ui/base/ime/input_method_chromeos.cc ('K') | « ui/base/ime/input_method_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698