OLD | NEW |
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/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h" | 5 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 | 800 |
801 TEST_F(XkbLayoutEngineVkTest, KeyboardCodeForNonPrintable) { | 801 TEST_F(XkbLayoutEngineVkTest, KeyboardCodeForNonPrintable) { |
802 static const struct { | 802 static const struct { |
803 VkTestXkbKeyboardLayoutEngine::KeysymEntry test; | 803 VkTestXkbKeyboardLayoutEngine::KeysymEntry test; |
804 KeyboardCode key_code; | 804 KeyboardCode key_code; |
805 } kVkeyTestCase[] = { | 805 } kVkeyTestCase[] = { |
806 {{DomCode::CONTROL_LEFT, XKB_KEY_Control_L}, VKEY_CONTROL}, | 806 {{DomCode::CONTROL_LEFT, XKB_KEY_Control_L}, VKEY_CONTROL}, |
807 {{DomCode::CONTROL_RIGHT, XKB_KEY_Control_R}, VKEY_CONTROL}, | 807 {{DomCode::CONTROL_RIGHT, XKB_KEY_Control_R}, VKEY_CONTROL}, |
808 {{DomCode::SHIFT_LEFT, XKB_KEY_Shift_L}, VKEY_SHIFT}, | 808 {{DomCode::SHIFT_LEFT, XKB_KEY_Shift_L}, VKEY_SHIFT}, |
809 {{DomCode::SHIFT_RIGHT, XKB_KEY_Shift_R}, VKEY_SHIFT}, | 809 {{DomCode::SHIFT_RIGHT, XKB_KEY_Shift_R}, VKEY_SHIFT}, |
810 {{DomCode::OS_LEFT, XKB_KEY_Super_L}, VKEY_LWIN}, | 810 {{DomCode::META_LEFT, XKB_KEY_Super_L}, VKEY_LWIN}, |
811 {{DomCode::OS_RIGHT, XKB_KEY_Super_R}, VKEY_LWIN}, | 811 {{DomCode::META_RIGHT, XKB_KEY_Super_R}, VKEY_LWIN}, |
812 {{DomCode::ALT_LEFT, XKB_KEY_Alt_L}, VKEY_MENU}, | 812 {{DomCode::ALT_LEFT, XKB_KEY_Alt_L}, VKEY_MENU}, |
813 {{DomCode::ALT_RIGHT, XKB_KEY_Alt_R}, VKEY_MENU}, | 813 {{DomCode::ALT_RIGHT, XKB_KEY_Alt_R}, VKEY_MENU}, |
814 {{DomCode::ALT_RIGHT, XKB_KEY_ISO_Level3_Shift}, VKEY_ALTGR}, | 814 {{DomCode::ALT_RIGHT, XKB_KEY_ISO_Level3_Shift}, VKEY_ALTGR}, |
815 {{DomCode::DIGIT1, XKB_KEY_1}, VKEY_1}, | 815 {{DomCode::DIGIT1, XKB_KEY_1}, VKEY_1}, |
816 {{DomCode::NUMPAD1, XKB_KEY_KP_1}, VKEY_1}, | 816 {{DomCode::NUMPAD1, XKB_KEY_KP_1}, VKEY_1}, |
817 {{DomCode::CAPS_LOCK, XKB_KEY_Caps_Lock}, VKEY_CAPITAL}, | 817 {{DomCode::CAPS_LOCK, XKB_KEY_Caps_Lock}, VKEY_CAPITAL}, |
818 {{DomCode::ENTER, XKB_KEY_Return}, VKEY_RETURN}, | 818 {{DomCode::ENTER, XKB_KEY_Return}, VKEY_RETURN}, |
819 {{DomCode::NUMPAD_ENTER, XKB_KEY_KP_Enter}, VKEY_RETURN}, | 819 {{DomCode::NUMPAD_ENTER, XKB_KEY_KP_Enter}, VKEY_RETURN}, |
820 {{DomCode::SLEEP, XKB_KEY_XF86Sleep}, VKEY_SLEEP}, | 820 {{DomCode::SLEEP, XKB_KEY_XF86Sleep}, VKEY_SLEEP}, |
821 // Verify that number pad digits produce located VKEY codes. | 821 // Verify that number pad digits produce located VKEY codes. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 std::string layout_id; | 895 std::string layout_id; |
896 std::string layout_variant; | 896 std::string layout_variant; |
897 XkbKeyboardLayoutEngine::ParseLayoutName(e->layout_name, &layout_id, | 897 XkbKeyboardLayoutEngine::ParseLayoutName(e->layout_name, &layout_id, |
898 &layout_variant); | 898 &layout_variant); |
899 EXPECT_EQ(layout_id, e->layout); | 899 EXPECT_EQ(layout_id, e->layout); |
900 EXPECT_EQ(layout_variant, e->variant); | 900 EXPECT_EQ(layout_variant, e->variant); |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 } // namespace ui | 904 } // namespace ui |
OLD | NEW |