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

Unified Diff: ui/events/keycodes/platform_key_map_win_unittest.cc

Issue 2046193002: [DomKey] Expose Korean special keys on Korean keyboard layout only (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
Index: ui/events/keycodes/platform_key_map_win_unittest.cc
diff --git a/ui/events/keycodes/platform_key_map_win_unittest.cc b/ui/events/keycodes/platform_key_map_win_unittest.cc
index 1a3fb352f79868bc4ea3cc970792f6425e68cec4..c684b52006a54470ef26bf46810045e624f8ddf0 100644
--- a/ui/events/keycodes/platform_key_map_win_unittest.cc
+++ b/ui/events/keycodes/platform_key_map_win_unittest.cc
@@ -19,6 +19,7 @@ namespace {
const wchar_t* LAYOUT_US = L"00000409";
const wchar_t* LAYOUT_FR = L"0000040c";
+const wchar_t* LAYOUT_KO = L"00000412";
struct TestKey {
// Have to use KeyboardCode instead of DomCode because we don't know the
@@ -287,4 +288,31 @@ TEST_F(PlatformKeyMapTest, NonPrintableKey) {
}
}
+TEST_F(PlatformKeyMapTest, KoreanSpecialDomKey) {
Wez 2016/06/10 22:55:09 nit: Suggest just KoreanDomKey or KoreanSpecificKe
chongz 2016/06/14 20:41:47 Done.
+ const struct TestCase {
+ KeyboardCode key_code;
+ DomKey key;
+ } kKoreanTestCases[] = {
+ {VKEY_HANGUL, DomKey::HANGUL_MODE}, {VKEY_HANJA, DomKey::HANJA_MODE},
+ };
+
+ // US layout does not have these keys.
Wez 2016/06/10 22:55:09 nit: "US English should not return values for thes
chongz 2016/06/14 20:41:47 Done.
+ HKL us_layout = ::LoadKeyboardLayout(LAYOUT_US, 0);
+ PlatformKeyMap us_keymap(us_layout);
+ for (const auto& test_case : kKoreanTestCases) {
+ EXPECT_EQ(DomKey::NONE, DomKeyFromNativeImpl(us_keymap, DomCode::NONE,
+ test_case.key_code, EF_NONE))
+ << test_case.key_code;
+ }
+
+ // Korean layout should return specific DomKey.
+ HKL ko_layout = ::LoadKeyboardLayout(LAYOUT_KO, 0);
+ PlatformKeyMap ko_keymap(ko_layout);
+ for (const auto& test_case : kKoreanTestCases) {
+ EXPECT_EQ(test_case.key, DomKeyFromNativeImpl(ko_keymap, DomCode::NONE,
+ test_case.key_code, EF_NONE))
+ << test_case.key_code;
+ }
+}
+
} // namespace ui
« ui/events/keycodes/platform_key_map_win.cc ('K') | « ui/events/keycodes/platform_key_map_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698