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
3 // found in the LICENSE file.
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "ui/events/event_constants.h"
7 #include "ui/events/keycodes/dom3/dom_code.h"
8 #include "ui/events/keycodes/dom3/dom_key.h"
9 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h"
10 #include "ui/events/ozone/layout/layout_util.h"
11 #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h"
17 // This XkbKeyCodeConverter simply uses the numeric value of the DomCode.
18 class VkTestXkbKeyCodeConverter
: public XkbKeyCodeConverter
{
20 VkTestXkbKeyCodeConverter() {
21 invalid_xkb_keycode_
= static_cast<xkb_keycode_t
>(DomCode::NONE
);
23 ~VkTestXkbKeyCodeConverter() override
{}
24 xkb_keycode_t
DomCodeToXkbKeyCode(DomCode dom_code
) const override
{
25 return static_cast<xkb_keycode_t
>(dom_code
);
29 // This mock XkbKeyboardLayoutEngine fakes a layout that succeeds only when the
30 // supplied keycode matches its |Entry|, in which case it supplies DomKey::NONE
31 // and a character that depends on the flags.
32 class VkTestXkbKeyboardLayoutEngine
: public XkbKeyboardLayoutEngine
{
35 base::char16 plain_character
;
36 base::char16 shift_character
;
37 base::char16 altgr_character
;
39 ui::KeyboardCode key_code
;
43 std::string layout_name
;
49 VkTestXkbKeyboardLayoutEngine(const XkbKeyCodeConverter
& keycode_converter
)
50 : XkbKeyboardLayoutEngine(keycode_converter
), entry_(nullptr) {
51 // For testing, use the same modifier values as ui::EventFlags.
52 static const int kTestFlags
[] = {
53 EF_SHIFT_DOWN
, EF_ALTGR_DOWN
, EF_MOD3_DOWN
};
54 xkb_flag_map_
.clear();
55 xkb_flag_map_
.resize(arraysize(kTestFlags
));
56 for (size_t i
= 0; i
< arraysize(kTestFlags
); ++i
) {
57 XkbFlagMapEntry e
= {kTestFlags
[i
], kTestFlags
[i
]};
58 xkb_flag_map_
.push_back(e
);
61 ~VkTestXkbKeyboardLayoutEngine() override
{}
63 void SetEntry(const Entry
* entry
) { entry_
= entry
; }
65 xkb_keysym_t
CharacterToKeySym(base::char16 c
) const {
66 return 0x01000000u
+ c
;
69 KeyboardCode
GetKeyboardCode(DomCode dom_code
,
71 base::char16 character
) const {
72 KeyboardCode key_code
= DifficultKeyboardCode(
73 dom_code
, flags
, key_code_converter_
.DomCodeToXkbKeyCode(dom_code
),
74 flags
, CharacterToKeySym(character
), DomKey::CHARACTER
, character
);
75 if (key_code
== VKEY_UNKNOWN
)
76 key_code
= DomCodeToNonLocatedKeyboardCode(dom_code
);
80 // XkbKeyboardLayoutEngine overrides:
81 bool XkbLookup(xkb_keycode_t xkb_keycode
,
82 xkb_mod_mask_t xkb_flags
,
83 xkb_keysym_t
* xkb_keysym
,
84 base::char16
* character
) const override
{
86 (xkb_keycode
!= static_cast<xkb_keycode_t
>(entry_
->dom_code
)))
88 if (xkb_flags
& EF_ALTGR_DOWN
)
89 *character
= entry_
->altgr_character
;
90 else if (xkb_flags
& EF_SHIFT_DOWN
)
91 *character
= entry_
->shift_character
;
93 *character
= entry_
->plain_character
;
94 *xkb_keysym
= CharacterToKeySym(*character
);
95 return *character
!= 0;
102 } // anonymous namespace
104 class XkbLayoutEngineVkTest
: public testing::Test
{
106 XkbLayoutEngineVkTest() {}
107 ~XkbLayoutEngineVkTest() override
{}
109 void SetUp() override
{
110 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
111 make_scoped_ptr(new VkTestXkbKeyboardLayoutEngine(keycode_converter_
)));
112 layout_engine_
= static_cast<VkTestXkbKeyboardLayoutEngine
*>(
113 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine());
115 void TearDown() override
{}
118 VkTestXkbKeyCodeConverter keycode_converter_
;
119 VkTestXkbKeyboardLayoutEngine
* layout_engine_
;
122 TEST_F(XkbLayoutEngineVkTest
, KeyboardCodeForPrintable
) {
123 // This table contains U+2460 CIRCLED DIGIT ONE, U+2461 CIRCLED DIGIT TWO,
124 // and DomCode::NONE where the result should not depend on those values.
125 static const VkTestXkbKeyboardLayoutEngine::Entry kVkeyTestCase
[] = {
126 // Cases requiring mapping tables.
127 // exclamation mark, *, *
128 /* 0 */ {0x0021, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
129 // exclamation mark, *, *
130 /* 1 */ {0x0021, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
131 // exclamation mark, *, *
132 /* 2 */ {0x0021, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_8
},
133 // quotation mark, *, *
134 /* 3 */ {0x0022, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
135 // quotation mark, *, *
136 /* 4 */ {0x0022, 0x2460, 0x2461, DomCode::DIGIT3
, VKEY_3
},
137 // number sign, apostrophe, *
138 /* 5 */ {0x0023, 0x0027, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
139 // number sign, tilde, unmapped
140 /* 6 */ {0x0023, 0x007E, 0x0000, DomCode::BACKSLASH
, VKEY_OEM_7
},
142 /* 7 */ {0x0023, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_7
},
144 /* 8 */ {0x0024, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_8
},
146 /* 9 */ {0x0024, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_1
},
147 // percent sign, *, *
148 /* 10 */ {0x0025, 0x2460, 0x2461, DomCode::NONE
, VKEY_5
},
150 /* 11 */ {0x0026, 0x2460, 0x2461, DomCode::NONE
, VKEY_1
},
151 // apostrophe, unmapped, *
152 /* 12 */ {0x0027, 0x0000, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
153 // apostrophe, quotation mark, unmapped
154 /* 13 */ {0x0027, 0x0022, 0x0000, DomCode::KEY_Z
, VKEY_Z
},
155 // apostrophe, quotation mark, R caron
156 /* 14 */ {0x0027, 0x0022, 0x0158, DomCode::KEY_Z
, VKEY_OEM_7
},
157 // apostrophe, quotation mark, *
158 /* 15 */ {0x0027, 0x0022, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_3
},
159 // apostrophe, quotation mark, *
160 /* 16 */ {0x0027, 0x0022, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
161 // apostrophe, asterisk, unmapped
162 /* 17 */ {0x0027, 0x002A, 0x0000, DomCode::BACKSLASH
, VKEY_OEM_2
},
163 // apostrophe, asterisk, unmapped
164 /* 18 */ {0x0027, 0x002A, 0x0000, DomCode::EQUAL
, VKEY_OEM_PLUS
},
165 // apostrophe, asterisk, vulgar fraction one half
166 /* 19 */ {0x0027, 0x002A, 0x00BD, DomCode::BACKSLASH
, VKEY_OEM_5
},
167 // apostrophe, asterisk, L stroke
168 /* 20 */ {0x0027, 0x002A, 0x0141, DomCode::BACKSLASH
, VKEY_OEM_2
},
169 // apostrophe, question mark, unmapped
170 /* 21 */ {0x0027, 0x003F, 0x0000, DomCode::MINUS
, VKEY_OEM_4
},
171 // apostrophe, question mark, Y acute
172 /* 22 */ {0x0027, 0x003F, 0x00DD, DomCode::MINUS
, VKEY_OEM_4
},
173 // apostrophe, commercial at, unmapped
174 /* 23 */ {0x0027, 0x0040, 0x0000, DomCode::QUOTE
, VKEY_OEM_3
},
175 // apostrophe, middle dot, *
176 /* 24 */ {0x0027, 0x00B7, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_5
},
178 /* 25 */ {0x0027, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_1
},
180 /* 26 */ {0x0027, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
182 /* 27 */ {0x0027, 0x2460, 0x2461, DomCode::KEY_Q
, VKEY_OEM_7
},
184 /* 28 */ {0x0027, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_7
},
185 // left parenthesis, *, *
186 /* 29 */ {0x0028, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
187 // left parenthesis, *, *
188 /* 30 */ {0x0028, 0x2460, 0x2461, DomCode::DIGIT5
, VKEY_5
},
189 // left parenthesis, *, *
190 /* 31 */ {0x0028, 0x2460, 0x2461, DomCode::DIGIT9
, VKEY_9
},
191 // right parenthesis, *, *
192 /* 32 */ {0x0029, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
193 // right parenthesis, *, *
194 /* 33 */ {0x0029, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_0
},
195 // right parenthesis, *, *
196 /* 34 */ {0x0029, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_4
},
198 /* 35 */ {0x002A, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
200 /* 36 */ {0x002A, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_1
},
201 // plus sign, question mark, unmapped
202 /* 37 */ {0x002B, 0x003F, 0x0000, DomCode::MINUS
, VKEY_OEM_PLUS
},
203 // plus sign, question mark, reverse solidus
204 /* 38 */ {0x002B, 0x003F, 0x005C, DomCode::MINUS
, VKEY_OEM_MINUS
},
205 // plus sign, question mark, o double acute
206 /* 39 */ {0x002B, 0x003F, 0x0151, DomCode::MINUS
, VKEY_OEM_PLUS
},
208 /* 40 */ {0x002B, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
210 /* 41 */ {0x002B, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_PLUS
},
212 /* 42 */ {0x002B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_PLUS
},
214 /* 43 */ {0x002B, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
216 /* 44 */ {0x002B, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_PLUS
},
218 /* 45 */ {0x002B, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_PLUS
},
220 /* 46 */ {0x002C, 0x2460, 0x2461, DomCode::COMMA
, VKEY_OEM_COMMA
},
222 /* 47 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT3
, VKEY_3
},
224 /* 48 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT5
, VKEY_5
},
226 /* 49 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
228 /* 50 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT9
, VKEY_9
},
230 /* 51 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_M
, VKEY_OEM_COMMA
},
232 /* 52 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_V
, VKEY_OEM_COMMA
},
234 /* 53 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_W
, VKEY_OEM_COMMA
},
235 // hyphen-minus, equals sign, *
236 /* 54 */ {0x002D, 0x003D, 0x2461, DomCode::SLASH
, VKEY_OEM_MINUS
},
237 // hyphen-minus, low line, unmapped
238 /* 55 */ {0x002D, 0x005F, 0x0000, DomCode::EQUAL
, VKEY_OEM_MINUS
},
239 // hyphen-minus, low line, unmapped
240 /* 56 */ {0x002D, 0x005F, 0x0000, DomCode::SLASH
, VKEY_OEM_MINUS
},
241 // hyphen-minus, low line, asterisk
242 /* 57 */ {0x002D, 0x005F, 0x002A, DomCode::SLASH
, VKEY_OEM_MINUS
},
243 // hyphen-minus, low line, solidus
244 /* 58 */ {0x002D, 0x005F, 0x002F, DomCode::SLASH
, VKEY_OEM_2
},
245 // hyphen-minus, low line, n
246 /* 59 */ {0x002D, 0x005F, 0x006E, DomCode::SLASH
, VKEY_OEM_MINUS
},
247 // hyphen-minus, low line, r cedilla
248 /* 60 */ {0x002D, 0x005F, 0x0157, DomCode::EQUAL
, VKEY_OEM_4
},
249 // hyphen-minus, *, *
250 /* 61 */ {0x002D, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
251 // hyphen-minus, *, *
252 /* 62 */ {0x002D, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
253 // hyphen-minus, *, *
254 /* 63 */ {0x002D, 0x2460, 0x2461, DomCode::KEY_A
, VKEY_OEM_MINUS
},
255 // hyphen-minus, *, *
256 /* 64 */ {0x002D, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_MINUS
},
257 // hyphen-minus, *, *
258 /* 65 */ {0x002D, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_MINUS
},
260 /* 66 */ {0x002E, 0x2460, 0x2461, DomCode::DIGIT7
, VKEY_7
},
262 /* 67 */ {0x002E, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
264 /* 68 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_E
, VKEY_OEM_PERIOD
},
266 /* 69 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_O
, VKEY_OEM_PERIOD
},
268 /* 70 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_R
, VKEY_OEM_PERIOD
},
270 /* 71 */ {0x002E, 0x2460, 0x2461, DomCode::PERIOD
, VKEY_OEM_PERIOD
},
272 /* 72 */ {0x002E, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
274 /* 73 */ {0x002E, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_2
},
275 // solidus, digit zero, *
276 /* 74 */ {0x002F, 0x0030, 0x2461, DomCode::DIGIT0
, VKEY_0
},
277 // solidus, digit three, *
278 /* 75 */ {0x002F, 0x0033, 0x2461, DomCode::DIGIT3
, VKEY_3
},
279 // solidus, question mark, *
280 /* 76 */ {0x002F, 0x003F, 0x2461, DomCode::DIGIT0
, VKEY_OEM_2
},
281 // solidus, question mark, *
282 /* 77 */ {0x002F, 0x003F, 0x2461, DomCode::DIGIT3
, VKEY_OEM_2
},
284 /* 78 */ {0x002F, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_7
},
286 /* 79 */ {0x002F, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
288 /* 80 */ {0x002F, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_2
},
290 /* 81 */ {0x002F, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_4
},
292 /* 82 */ {0x002F, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_2
},
294 /* 83 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
296 /* 84 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT5
, VKEY_5
},
298 /* 85 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
300 /* 86 */ {0x003A, 0x2460, 0x2461, DomCode::PERIOD
, VKEY_OEM_2
},
302 /* 87 */ {0x003B, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_3
},
304 /* 88 */ {0x003B, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_1
},
306 /* 89 */ {0x003B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
308 /* 90 */ {0x003B, 0x2460, 0x2461, DomCode::COMMA
, VKEY_OEM_PERIOD
},
310 /* 91 */ {0x003B, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
312 /* 92 */ {0x003B, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
314 /* 93 */ {0x003B, 0x2460, 0x2461, DomCode::KEY_Q
, VKEY_OEM_1
},
316 /* 94 */ {0x003B, 0x2460, 0x2461, DomCode::KEY_Z
, VKEY_OEM_1
},
318 /* 95 */ {0x003B, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
320 /* 96 */ {0x003B, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_2
},
321 // less-than sign, *, *
322 /* 97 */ {0x003C, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
323 // equals sign, percent sign, unmapped
324 /* 98 */ {0x003D, 0x0025, 0x0000, DomCode::MINUS
, VKEY_OEM_PLUS
},
325 // equals sign, percent sign, hyphen-minus
326 /* 99 */ {0x003D, 0x0025, 0x002D, DomCode::MINUS
, VKEY_OEM_MINUS
},
327 // equals sign, percent sign, *
328 /* 100 */ {0x003D, 0x0025, 0x2461, DomCode::SLASH
, VKEY_OEM_8
},
329 // equals sign, plus sign, *
330 /* 101 */ {0x003D, 0x002B, 0x2461, DomCode::SLASH
, VKEY_OEM_PLUS
},
332 /* 102 */ {0x003D, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_PLUS
},
334 /* 103 */ {0x003D, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
336 /* 104 */ {0x003D, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_PLUS
},
337 // question mark, *, *
338 /* 105 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
339 // question mark, *, *
340 /* 106 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT7
, VKEY_7
},
341 // question mark, *, *
342 /* 107 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
343 // question mark, *, *
344 /* 108 */ {0x003F, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_PLUS
},
345 // commercial at, *, *
346 /* 109 */ {0x0040, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_7
},
347 // commercial at, *, *
348 /* 110 */ {0x0040, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
349 // left square bracket, *, *
350 /* 111 */ {0x005B, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
351 // left square bracket, *, *
352 /* 112 */ {0x005B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
353 // left square bracket, *, *
354 /* 113 */ {0x005B, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_OEM_4
},
355 // left square bracket, *, *
356 /* 114 */ {0x005B, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_4
},
357 // left square bracket, *, *
358 /* 115 */ {0x005B, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
359 // reverse solidus, solidus, *
360 /* 116 */ {0x005C, 0x002F, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_7
},
361 // reverse solidus, vertical line, digit one
362 /* 117 */ {0x005C, 0x007C, 0x0031, DomCode::BACKQUOTE
, VKEY_OEM_5
},
363 // reverse solidus, vertical line, N cedilla
364 /* 118 */ {0x005C, 0x007C, 0x0145, DomCode::BACKQUOTE
, VKEY_OEM_3
},
365 // reverse solidus, vertical line, *
366 /* 119 */ {0x005C, 0x007C, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
367 // reverse solidus, *, *
368 /* 120 */ {0x005C, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_4
},
369 // right square bracket, *, *
370 /* 121 */ {0x005D, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_3
},
371 // right square bracket, *, *
372 /* 122 */ {0x005D, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
373 // right square bracket, *, *
374 /* 123 */ {0x005D, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
375 // right square bracket, *, *
376 /* 124 */ {0x005D, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_OEM_6
},
377 // right square bracket, *, *
378 /* 125 */ {0x005D, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_6
},
380 /* 126 */ {0x005F, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
382 /* 127 */ {0x005F, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_MINUS
},
383 // grave accent, unmapped, *
384 /* 128 */ {0x0060, 0x0000, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_3
},
385 // grave accent, tilde, unmapped
386 /* 129 */ {0x0060, 0x007E, 0x0000, DomCode::BACKQUOTE
, VKEY_OEM_3
},
387 // grave accent, tilde, digit one
388 /* 130 */ {0x0060, 0x007E, 0x0031, DomCode::BACKQUOTE
, VKEY_OEM_3
},
389 // grave accent, tilde, semicolon
390 /* 131 */ {0x0060, 0x007E, 0x003B, DomCode::BACKQUOTE
, VKEY_OEM_3
},
391 // grave accent, tilde, grave accent
392 /* 132 */ {0x0060, 0x007E, 0x0060, DomCode::BACKQUOTE
, VKEY_OEM_3
},
393 // grave accent, tilde, inverted question mark
394 /* 133 */ {0x0060, 0x007E, 0x00BF, DomCode::BACKQUOTE
, VKEY_OEM_3
},
395 // grave accent, tilde, o double acute
396 /* 134 */ {0x0060, 0x007E, 0x0151, DomCode::BACKQUOTE
, VKEY_OEM_3
},
397 // grave accent, not sign, *
398 /* 135 */ {0x0060, 0x00AC, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_8
},
399 // left curly bracket, *, *
400 /* 136 */ {0x007B, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_7
},
401 // vertical line, *, *
402 /* 137 */ {0x007C, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
403 // right curly bracket, *, *
404 /* 138 */ {0x007D, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_2
},
406 /* 139 */ {0x007E, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
407 // inverted exclamation mark, *, *
408 /* 140 */ {0x00A1, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
409 // section sign, degree sign, *
410 /* 141 */ {0x00A7, 0x00B0, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_2
},
411 // section sign, vulgar fraction one half, *
412 /* 142 */ {0x00A7, 0x00BD, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_5
},
413 // section sign, *, *
414 /* 143 */ {0x00A7, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
415 // section sign, *, *
416 /* 144 */ {0x00A7, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
417 // section sign, *, *
418 /* 145 */ {0x00A7, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
419 // left-pointing double angle quotation mark, *, *
420 /* 146 */ {0x00AB, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
421 // left-pointing double angle quotation mark, *, *
422 /* 147 */ {0x00AB, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_6
},
424 /* 148 */ {0x00AD, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
426 /* 149 */ {0x00B0, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_7
},
428 /* 150 */ {0x00B0, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_2
},
429 // superscript two, *, *
430 /* 151 */ {0x00B2, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_7
},
432 /* 152 */ {0x00B5, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
433 // masculine ordinal indicator, *, *
434 /* 153 */ {0x00BA, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_5
},
435 // masculine ordinal indicator, *, *
436 /* 154 */ {0x00BA, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
437 // right-pointing double angle quotation mark, *, *
438 /* 155 */ {0x00BB, 0x2460, 0x2461, DomCode::NONE
, VKEY_9
},
439 // vulgar fraction one half, *, *
440 /* 156 */ {0x00BD, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
441 // inverted question mark, *, *
442 /* 157 */ {0x00BF, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
444 /* 158 */ {0x00DF, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
445 // a grave, degree sign, *
446 /* 159 */ {0x00E0, 0x00B0, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
447 // a grave, a diaeresis, *
448 /* 160 */ {0x00E0, 0x00E4, 0x2461, DomCode::QUOTE
, VKEY_OEM_5
},
450 /* 161 */ {0x00E0, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
452 /* 162 */ {0x00E0, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_0
},
454 /* 163 */ {0x00E1, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
456 /* 164 */ {0x00E1, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
457 // a circumflex, *, *
458 /* 165 */ {0x00E2, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
459 // a circumflex, *, *
460 /* 166 */ {0x00E2, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
461 // a diaeresis, A diaeresis, unmapped
462 /* 167 */ {0x00E4, 0x00C4, 0x0000, DomCode::QUOTE
, VKEY_OEM_7
},
463 // a diaeresis, A diaeresis, r caron
464 /* 168 */ {0x00E4, 0x00C4, 0x0159, DomCode::QUOTE
, VKEY_OEM_7
},
465 // a diaeresis, A diaeresis, S acute
466 /* 169 */ {0x00E4, 0x00C4, 0x015A, DomCode::QUOTE
, VKEY_OEM_7
},
467 // a diaeresis, a grave, *
468 /* 170 */ {0x00E4, 0x00E0, 0x2461, DomCode::QUOTE
, VKEY_OEM_5
},
470 /* 171 */ {0x00E4, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
471 // a ring above, *, *
472 /* 172 */ {0x00E5, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
474 /* 173 */ {0x00E6, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
476 /* 174 */ {0x00E6, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_3
},
477 // c cedilla, C cedilla, unmapped
478 /* 175 */ {0x00E7, 0x00C7, 0x0000, DomCode::SEMICOLON
, VKEY_OEM_1
},
479 // c cedilla, C cedilla, Thorn
480 /* 176 */ {0x00E7, 0x00C7, 0x00DE, DomCode::SEMICOLON
, VKEY_OEM_3
},
482 /* 177 */ {0x00E7, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
484 /* 178 */ {0x00E7, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
486 /* 179 */ {0x00E7, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
488 /* 180 */ {0x00E7, 0x2460, 0x2461, DomCode::COMMA
, VKEY_OEM_COMMA
},
490 /* 181 */ {0x00E7, 0x2460, 0x2461, DomCode::DIGIT9
, VKEY_9
},
492 /* 182 */ {0x00E7, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
494 /* 183 */ {0x00E8, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_1
},
496 /* 184 */ {0x00E8, 0x2460, 0x2461, DomCode::DIGIT7
, VKEY_7
},
498 /* 185 */ {0x00E8, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_3
},
499 // e acute, E acute, *
500 /* 186 */ {0x00E9, 0x00C9, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
501 // e acute, o diaeresis, *
502 /* 187 */ {0x00E9, 0x00F6, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_7
},
504 /* 188 */ {0x00E9, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_0
},
506 /* 189 */ {0x00E9, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
508 /* 190 */ {0x00E9, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_2
},
509 // e circumflex, *, *
510 /* 191 */ {0x00EA, 0x2460, 0x2461, DomCode::NONE
, VKEY_3
},
512 /* 192 */ {0x00EB, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_1
},
514 /* 193 */ {0x00EC, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
516 /* 194 */ {0x00ED, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_0
},
518 /* 195 */ {0x00ED, 0x2460, 0x2461, DomCode::DIGIT9
, VKEY_9
},
519 // i circumflex, *, *
520 /* 196 */ {0x00EE, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
522 /* 197 */ {0x00F0, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_6
},
524 /* 198 */ {0x00F0, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_1
},
526 /* 199 */ {0x00F1, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
528 /* 200 */ {0x00F2, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
530 /* 201 */ {0x00F3, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
532 /* 202 */ {0x00F3, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_PLUS
},
533 // o circumflex, *, *
534 /* 203 */ {0x00F4, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
535 // o circumflex, *, *
536 /* 204 */ {0x00F4, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
538 /* 205 */ {0x00F5, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
539 // o diaeresis, O diaeresis, unmapped
540 /* 206 */ {0x00F6, 0x00D6, 0x0000, DomCode::SEMICOLON
, VKEY_OEM_3
},
541 // o diaeresis, O diaeresis, T cedilla
542 /* 207 */ {0x00F6, 0x00D6, 0x0162, DomCode::SEMICOLON
, VKEY_OEM_3
},
543 // o diaeresis, e acute, *
544 /* 208 */ {0x00F6, 0x00E9, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_7
},
546 /* 209 */ {0x00F6, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
548 /* 210 */ {0x00F6, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_OEM_3
},
550 /* 211 */ {0x00F6, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_PLUS
},
551 // division sign, *, *
552 /* 212 */ {0x00F7, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
554 /* 213 */ {0x00F8, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
556 /* 214 */ {0x00F8, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_3
},
558 /* 215 */ {0x00F9, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
560 /* 216 */ {0x00F9, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_3
},
562 /* 217 */ {0x00FA, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
564 /* 218 */ {0x00FA, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
565 // u diaeresis, U diaeresis, unmapped
566 /* 219 */ {0x00FC, 0x00DC, 0x0000, DomCode::BRACKET_LEFT
, VKEY_OEM_1
},
567 // u diaeresis, U diaeresis, unmapped
568 /* 220 */ {0x00FC, 0x00DC, 0x0000, DomCode::MINUS
, VKEY_OEM_2
},
569 // u diaeresis, U diaeresis, L stroke
570 /* 221 */ {0x00FC, 0x00DC, 0x0141, DomCode::BRACKET_LEFT
, VKEY_OEM_3
},
571 // u diaeresis, e grave, *
572 /* 222 */ {0x00FC, 0x00E8, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_1
},
574 /* 223 */ {0x00FC, 0x2460, 0x2461, DomCode::KEY_W
, VKEY_W
},
576 /* 224 */ {0x00FD, 0x2460, 0x2461, DomCode::NONE
, VKEY_7
},
578 /* 225 */ {0x00FE, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_MINUS
},
580 /* 226 */ {0x0101, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_8
},
582 /* 227 */ {0x0103, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
584 /* 228 */ {0x0103, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
586 /* 229 */ {0x0105, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
588 /* 230 */ {0x0105, 0x2460, 0x2461, DomCode::KEY_Q
, VKEY_Q
},
590 /* 231 */ {0x0105, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
592 /* 232 */ {0x0107, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_7
},
594 /* 233 */ {0x010B, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
596 /* 234 */ {0x010D, 0x2460, 0x2461, DomCode::COMMA
, VKEY_OEM_COMMA
},
598 /* 235 */ {0x010D, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
600 /* 236 */ {0x010D, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
602 /* 237 */ {0x010D, 0x2460, 0x2461, DomCode::KEY_P
, VKEY_X
},
604 /* 238 */ {0x010D, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
606 /* 239 */ {0x0111, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
608 /* 240 */ {0x0111, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_0
},
610 /* 241 */ {0x0113, 0x2460, 0x2461, DomCode::NONE
, VKEY_W
},
612 /* 242 */ {0x0117, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
614 /* 243 */ {0x0117, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
615 // e ogonek, E ogonek, unmapped
616 /* 244 */ {0x0119, 0x0118, 0x0000, DomCode::SLASH
, VKEY_OEM_MINUS
},
617 // e ogonek, E ogonek, n
618 /* 245 */ {0x0119, 0x0118, 0x006E, DomCode::SLASH
, VKEY_OEM_2
},
620 /* 246 */ {0x0119, 0x2460, 0x2461, DomCode::DIGIT3
, VKEY_3
},
622 /* 247 */ {0x011B, 0x2460, 0x2461, DomCode::NONE
, VKEY_2
},
624 /* 248 */ {0x011F, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
626 /* 249 */ {0x0121, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
628 /* 250 */ {0x0127, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
630 /* 251 */ {0x012B, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
631 // i ogonek, I ogonek, unmapped
632 /* 252 */ {0x012F, 0x012E, 0x0000, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
634 /* 253 */ {0x012F, 0x2460, 0x2461, DomCode::DIGIT5
, VKEY_5
},
636 /* 254 */ {0x0131, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_1
},
638 /* 255 */ {0x0137, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
640 /* 256 */ {0x013C, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_2
},
642 /* 257 */ {0x013E, 0x2460, 0x2461, DomCode::NONE
, VKEY_2
},
644 /* 258 */ {0x0142, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
646 /* 259 */ {0x0142, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
648 /* 260 */ {0x0146, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
650 /* 261 */ {0x0148, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
651 // o double acute, *, *
652 /* 262 */ {0x0151, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
654 /* 263 */ {0x0159, 0x2460, 0x2461, DomCode::NONE
, VKEY_5
},
656 /* 264 */ {0x015F, 0x2460, 0x2461, DomCode::PERIOD
, VKEY_OEM_PERIOD
},
658 /* 265 */ {0x015F, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
660 /* 266 */ {0x0161, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
662 /* 267 */ {0x0161, 0x2460, 0x2461, DomCode::DIGIT3
, VKEY_3
},
664 /* 268 */ {0x0161, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
666 /* 269 */ {0x0161, 0x2460, 0x2461, DomCode::KEY_A
, VKEY_OEM_1
},
668 /* 270 */ {0x0161, 0x2460, 0x2461, DomCode::KEY_F
, VKEY_F
},
670 /* 271 */ {0x0161, 0x2460, 0x2461, DomCode::PERIOD
, VKEY_OEM_PERIOD
},
672 /* 272 */ {0x0163, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_7
},
674 /* 273 */ {0x0165, 0x2460, 0x2461, DomCode::NONE
, VKEY_5
},
676 /* 274 */ {0x016B, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
678 /* 275 */ {0x016B, 0x2460, 0x2461, DomCode::KEY_Q
, VKEY_Q
},
680 /* 276 */ {0x016B, 0x2460, 0x2461, DomCode::KEY_X
, VKEY_X
},
681 // u ring above, *, *
682 /* 277 */ {0x016F, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_1
},
683 // u double acute, *, *
684 /* 278 */ {0x0171, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
685 // u ogonek, U ogonek, unmapped
686 /* 279 */ {0x0173, 0x0172, 0x0000, DomCode::SEMICOLON
, VKEY_OEM_3
},
687 // u ogonek, U ogonek, T cedilla
688 /* 280 */ {0x0173, 0x0172, 0x0162, DomCode::SEMICOLON
, VKEY_OEM_1
},
690 /* 281 */ {0x0173, 0x2460, 0x2461, DomCode::DIGIT7
, VKEY_7
},
692 /* 282 */ {0x017C, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
694 /* 283 */ {0x017C, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
696 /* 284 */ {0x017E, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
698 /* 285 */ {0x017E, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_Y
},
700 /* 286 */ {0x017E, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
702 /* 287 */ {0x017E, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_PLUS
},
704 /* 288 */ {0x017E, 0x2460, 0x2461, DomCode::KEY_W
, VKEY_W
},
706 /* 289 */ {0x01A1, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
708 /* 290 */ {0x01B0, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
710 /* 291 */ {0x01B6, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
712 /* 292 */ {0x0259, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
714 // Simple alphanumeric cases.
715 /* 293 */ {'a', 'A', '?', DomCode::NONE
, VKEY_A
},
716 /* 294 */ {'z', 'Z', '!', DomCode::NONE
, VKEY_Z
},
717 /* 295 */ {'9', '(', '+', DomCode::NONE
, VKEY_9
},
718 /* 296 */ {'0', ')', '-', DomCode::NONE
, VKEY_0
},
721 for (size_t i
= 0; i
< arraysize(kVkeyTestCase
); ++i
) {
723 const VkTestXkbKeyboardLayoutEngine::Entry
* e
= &kVkeyTestCase
[i
];
724 layout_engine_
->SetEntry(e
);
726 // Test with predetermined plain character.
727 KeyboardCode key_code
= layout_engine_
->GetKeyboardCode(
728 e
->dom_code
, EF_NONE
, e
->plain_character
);
729 EXPECT_EQ(e
->key_code
, key_code
);
731 if (e
->shift_character
) {
732 // Test with predetermined shifted character.
733 key_code
= layout_engine_
->GetKeyboardCode(e
->dom_code
, EF_SHIFT_DOWN
,
735 EXPECT_EQ(e
->key_code
, key_code
);
738 if (e
->altgr_character
) {
739 // Test with predetermined AltGr character.
740 key_code
= layout_engine_
->GetKeyboardCode(e
->dom_code
, EF_ALTGR_DOWN
,
742 EXPECT_EQ(e
->key_code
, key_code
);
745 // Test with unrelated predetermined character.
747 layout_engine_
->GetKeyboardCode(e
->dom_code
, EF_MOD3_DOWN
, 0xFFFFu
);
748 EXPECT_EQ(e
->key_code
, key_code
);
752 TEST_F(XkbLayoutEngineVkTest
, XkbRuleNamesForLayoutName
) {
753 static const VkTestXkbKeyboardLayoutEngine::RuleNames kVkeyTestCase
[] = {
754 /* 0 */ {"us", "us", ""},
755 /* 1 */ {"jp", "jp", ""},
756 /* 2 */ {"us(intl)", "us", "intl"},
757 /* 3 */ {"us(altgr-intl)", "us", "altgr-intl"},
758 /* 4 */ {"us(dvorak)", "us", "dvorak"},
759 /* 5 */ {"us(colemak)", "us", "colemak"},
760 /* 6 */ {"be", "be", ""},
761 /* 7 */ {"fr", "fr", ""},
762 /* 8 */ {"ca", "ca", ""},
763 /* 9 */ {"ch(fr)", "ch", "fr"},
764 /* 10 */ {"ca(multix)", "ca", "multix"},
765 /* 11 */ {"de", "de", ""},
766 /* 12 */ {"de(neo)", "de", "neo"},
767 /* 13 */ {"ch", "ch", ""},
768 /* 14 */ {"ru", "ru", ""},
769 /* 15 */ {"ru(phonetic)", "ru", "phonetic"},
770 /* 16 */ {"br", "br", ""},
771 /* 17 */ {"bg", "bg", ""},
772 /* 18 */ {"bg(phonetic)", "bg", "phonetic"},
773 /* 19 */ {"ca(eng)", "ca", "eng"},
774 /* 20 */ {"cz", "cz", ""},
775 /* 21 */ {"cz(qwerty)", "cz", "qwerty"},
776 /* 22 */ {"ee", "ee", ""},
777 /* 23 */ {"es", "es", ""},
778 /* 24 */ {"es(cat)", "es", "cat"},
779 /* 25 */ {"dk", "dk", ""},
780 /* 26 */ {"gr", "gr", ""},
781 /* 27 */ {"il", "il", ""},
782 /* 28 */ {"latam", "latam", ""},
783 /* 29 */ {"lt", "lt", ""},
784 /* 30 */ {"lv(apostrophe)", "lv", "apostrophe"},
785 /* 31 */ {"hr", "hr", ""},
786 /* 32 */ {"gb(extd)", "gb", "extd"},
787 /* 33 */ {"gb(dvorak)", "gb", "dvorak"},
788 /* 34 */ {"fi", "fi", ""},
789 /* 35 */ {"hu", "hu", ""},
790 /* 36 */ {"it", "it", ""},
791 /* 37 */ {"is", "is", ""},
792 /* 38 */ {"no", "no", ""},
793 /* 39 */ {"pl", "pl", ""},
794 /* 40 */ {"pt", "pt", ""},
795 /* 41 */ {"ro", "ro", ""},
796 /* 42 */ {"se", "se", ""},
797 /* 43 */ {"sk", "sk", ""},
798 /* 44 */ {"si", "si", ""},
799 /* 45 */ {"rs", "rs", ""},
800 /* 46 */ {"tr", "tr", ""},
801 /* 47 */ {"ua", "ua", ""},
802 /* 48 */ {"by", "by", ""},
803 /* 49 */ {"am", "am", ""},
804 /* 50 */ {"ge", "ge", ""},
805 /* 51 */ {"mn", "mn", ""},
806 /* 52 */ {"ie", "ie", ""}};
807 for (size_t i
= 0; i
< arraysize(kVkeyTestCase
); ++i
) {
809 const VkTestXkbKeyboardLayoutEngine::RuleNames
* e
= &kVkeyTestCase
[i
];
810 std::string layout_id
;
811 std::string layout_variant
;
812 XkbKeyboardLayoutEngine::ParseLayoutName(e
->layout_name
, &layout_id
,
814 EXPECT_EQ(layout_id
, e
->layout
);
815 EXPECT_EQ(layout_variant
, e
->variant
);