Chromium Code Reviews| 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 |