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

Side by Side Diff: ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc

Issue 2678283003: Fix 'events_unittests' build (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698