| 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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 816 {{DomCode::DIGIT1, EF_NONE, XKB_KEY_1}, VKEY_1}, | 816 {{DomCode::DIGIT1, EF_NONE, XKB_KEY_1}, VKEY_1}, |
| 817 {{DomCode::NUMPAD1, EF_NONE, XKB_KEY_KP_1}, VKEY_1}, | 817 {{DomCode::NUMPAD1, EF_NONE, XKB_KEY_KP_1}, VKEY_1}, |
| 818 {{DomCode::CAPS_LOCK, EF_NONE, XKB_KEY_Caps_Lock}, VKEY_CAPITAL}, | 818 {{DomCode::CAPS_LOCK, EF_NONE, XKB_KEY_Caps_Lock}, VKEY_CAPITAL}, |
| 819 {{DomCode::ENTER, EF_NONE, XKB_KEY_Return}, VKEY_RETURN}, | 819 {{DomCode::ENTER, EF_NONE, XKB_KEY_Return}, VKEY_RETURN}, |
| 820 {{DomCode::NUMPAD_ENTER, EF_NONE, XKB_KEY_KP_Enter}, VKEY_RETURN}, | 820 {{DomCode::NUMPAD_ENTER, EF_NONE, XKB_KEY_KP_Enter}, VKEY_RETURN}, |
| 821 {{DomCode::SLEEP, EF_NONE, XKB_KEY_XF86Sleep}, VKEY_SLEEP}, | 821 {{DomCode::SLEEP, EF_NONE, XKB_KEY_XF86Sleep}, VKEY_SLEEP}, |
| 822 // Verify that number pad digits produce located VKEY codes. | 822 // Verify that number pad digits produce located VKEY codes. |
| 823 {{DomCode::NUMPAD0, EF_NONE, XKB_KEY_KP_0, '0'}, VKEY_NUMPAD0}, | 823 {{DomCode::NUMPAD0, EF_NONE, XKB_KEY_KP_0, '0'}, VKEY_NUMPAD0}, |
| 824 {{DomCode::NUMPAD9, EF_NONE, XKB_KEY_KP_9, '9'}, VKEY_NUMPAD9}, | 824 {{DomCode::NUMPAD9, EF_NONE, XKB_KEY_KP_9, '9'}, VKEY_NUMPAD9}, |
| 825 // Verify AltGr+V & AltGr+W on de(neo) layout. | 825 // Verify AltGr+V & AltGr+W on de(neo) layout. |
| 826 {{DomCode::US_W, EF_ALTGR_DOWN, XKB_KEY_BackSpace, 8}, VKEY_BACKSPACE}, | 826 {{DomCode::US_W, EF_ALTGR_DOWN, XKB_KEY_BackSpace, 8}, VKEY_BACK}, |
| 827 {{DomCode::US_V, EF_ALTGR_DOWN, XKB_KEY_Return, 13}, VKEY_ENTER}, | 827 {{DomCode::US_V, EF_ALTGR_DOWN, XKB_KEY_Return, 13}, VKEY_RETURN}, |
| 828 }; | 828 }; |
| 829 for (const auto& e : kVkeyTestCase) { | 829 for (const auto& e : kVkeyTestCase) { |
| 830 SCOPED_TRACE(static_cast<int>(e.test.dom_code)); | 830 SCOPED_TRACE(static_cast<int>(e.test.dom_code)); |
| 831 layout_engine_->SetEntry(&e.test); | 831 layout_engine_->SetEntry(&e.test); |
| 832 DomKey dom_key = DomKey::NONE; | 832 DomKey dom_key = DomKey::NONE; |
| 833 KeyboardCode key_code = VKEY_UNKNOWN; | 833 KeyboardCode key_code = VKEY_UNKNOWN; |
| 834 EXPECT_TRUE(layout_engine_->Lookup(e.test.dom_code, e.test.flags, &dom_key, | 834 EXPECT_TRUE(layout_engine_->Lookup(e.test.dom_code, e.test.flags, &dom_key, |
| 835 &key_code)); | 835 &key_code)); |
| 836 EXPECT_EQ(e.key_code, key_code); | 836 EXPECT_EQ(e.key_code, key_code); |
| 837 } | 837 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 std::string layout_id; | 899 std::string layout_id; |
| 900 std::string layout_variant; | 900 std::string layout_variant; |
| 901 XkbKeyboardLayoutEngine::ParseLayoutName(e->layout_name, &layout_id, | 901 XkbKeyboardLayoutEngine::ParseLayoutName(e->layout_name, &layout_id, |
| 902 &layout_variant); | 902 &layout_variant); |
| 903 EXPECT_EQ(layout_id, e->layout); | 903 EXPECT_EQ(layout_id, e->layout); |
| 904 EXPECT_EQ(layout_variant, e->variant); | 904 EXPECT_EQ(layout_variant, e->variant); |
| 905 } | 905 } |
| 906 } | 906 } |
| 907 | 907 |
| 908 } // namespace ui | 908 } // namespace ui |
| OLD | NEW |