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/keycodes/keyboard_code_conversion.h"
10 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.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
) {
77 base::char16 dummy_character
;
78 // If this fails, key_code remains VKEY_UNKNOWN.
79 ignore_result(DomCodeToUsLayoutMeaning(dom_code
, EF_NONE
, &dummy_dom_key
,
80 &dummy_character
, &key_code
));
85 // XkbKeyboardLayoutEngine overrides:
86 bool XkbLookup(xkb_keycode_t xkb_keycode
,
87 xkb_mod_mask_t xkb_flags
,
88 xkb_keysym_t
* xkb_keysym
,
89 base::char16
* character
) const override
{
91 (xkb_keycode
!= static_cast<xkb_keycode_t
>(entry_
->dom_code
)))
93 if (xkb_flags
& EF_ALTGR_DOWN
)
94 *character
= entry_
->altgr_character
;
95 else if (xkb_flags
& EF_SHIFT_DOWN
)
96 *character
= entry_
->shift_character
;
98 *character
= entry_
->plain_character
;
99 *xkb_keysym
= CharacterToKeySym(*character
);
100 return *character
!= 0;
107 } // anonymous namespace
109 class XkbLayoutEngineVkTest
: public testing::Test
{
111 XkbLayoutEngineVkTest() {}
112 ~XkbLayoutEngineVkTest() override
{}
114 void SetUp() override
{
115 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(
116 make_scoped_ptr(new VkTestXkbKeyboardLayoutEngine(keycode_converter_
)));
117 layout_engine_
= static_cast<VkTestXkbKeyboardLayoutEngine
*>(
118 KeyboardLayoutEngineManager::GetKeyboardLayoutEngine());
120 void TearDown() override
{}
123 VkTestXkbKeyCodeConverter keycode_converter_
;
124 VkTestXkbKeyboardLayoutEngine
* layout_engine_
;
127 TEST_F(XkbLayoutEngineVkTest
, KeyboardCodeForPrintable
) {
128 // This table contains U+2460 CIRCLED DIGIT ONE, U+2461 CIRCLED DIGIT TWO,
129 // and DomCode::NONE where the result should not depend on those values.
130 static const VkTestXkbKeyboardLayoutEngine::Entry kVkeyTestCase
[] = {
131 // Cases requiring mapping tables.
132 // exclamation mark, *, *
133 /* 0 */ {0x0021, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
134 // exclamation mark, *, *
135 /* 1 */ {0x0021, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
136 // exclamation mark, *, *
137 /* 2 */ {0x0021, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_8
},
138 // quotation mark, *, *
139 /* 3 */ {0x0022, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
140 // quotation mark, *, *
141 /* 4 */ {0x0022, 0x2460, 0x2461, DomCode::DIGIT3
, VKEY_3
},
142 // number sign, apostrophe, *
143 /* 5 */ {0x0023, 0x0027, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
144 // number sign, tilde, unmapped
145 /* 6 */ {0x0023, 0x007E, 0x0000, DomCode::BACKSLASH
, VKEY_OEM_7
},
147 /* 7 */ {0x0023, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_7
},
149 /* 8 */ {0x0024, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_8
},
151 /* 9 */ {0x0024, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_1
},
152 // percent sign, *, *
153 /* 10 */ {0x0025, 0x2460, 0x2461, DomCode::NONE
, VKEY_5
},
155 /* 11 */ {0x0026, 0x2460, 0x2461, DomCode::NONE
, VKEY_1
},
156 // apostrophe, unmapped, *
157 /* 12 */ {0x0027, 0x0000, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
158 // apostrophe, quotation mark, unmapped
159 /* 13 */ {0x0027, 0x0022, 0x0000, DomCode::KEY_Z
, VKEY_Z
},
160 // apostrophe, quotation mark, R caron
161 /* 14 */ {0x0027, 0x0022, 0x0158, DomCode::KEY_Z
, VKEY_OEM_7
},
162 // apostrophe, quotation mark, *
163 /* 15 */ {0x0027, 0x0022, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_3
},
164 // apostrophe, quotation mark, *
165 /* 16 */ {0x0027, 0x0022, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
166 // apostrophe, asterisk, unmapped
167 /* 17 */ {0x0027, 0x002A, 0x0000, DomCode::BACKSLASH
, VKEY_OEM_2
},
168 // apostrophe, asterisk, unmapped
169 /* 18 */ {0x0027, 0x002A, 0x0000, DomCode::EQUAL
, VKEY_OEM_PLUS
},
170 // apostrophe, asterisk, vulgar fraction one half
171 /* 19 */ {0x0027, 0x002A, 0x00BD, DomCode::BACKSLASH
, VKEY_OEM_5
},
172 // apostrophe, asterisk, L stroke
173 /* 20 */ {0x0027, 0x002A, 0x0141, DomCode::BACKSLASH
, VKEY_OEM_2
},
174 // apostrophe, question mark, unmapped
175 /* 21 */ {0x0027, 0x003F, 0x0000, DomCode::MINUS
, VKEY_OEM_4
},
176 // apostrophe, question mark, Y acute
177 /* 22 */ {0x0027, 0x003F, 0x00DD, DomCode::MINUS
, VKEY_OEM_4
},
178 // apostrophe, commercial at, unmapped
179 /* 23 */ {0x0027, 0x0040, 0x0000, DomCode::QUOTE
, VKEY_OEM_3
},
180 // apostrophe, middle dot, *
181 /* 24 */ {0x0027, 0x00B7, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_5
},
183 /* 25 */ {0x0027, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_1
},
185 /* 26 */ {0x0027, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
187 /* 27 */ {0x0027, 0x2460, 0x2461, DomCode::KEY_Q
, VKEY_OEM_7
},
189 /* 28 */ {0x0027, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_7
},
190 // left parenthesis, *, *
191 /* 29 */ {0x0028, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
192 // left parenthesis, *, *
193 /* 30 */ {0x0028, 0x2460, 0x2461, DomCode::DIGIT5
, VKEY_5
},
194 // left parenthesis, *, *
195 /* 31 */ {0x0028, 0x2460, 0x2461, DomCode::DIGIT9
, VKEY_9
},
196 // right parenthesis, *, *
197 /* 32 */ {0x0029, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
198 // right parenthesis, *, *
199 /* 33 */ {0x0029, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_0
},
200 // right parenthesis, *, *
201 /* 34 */ {0x0029, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_4
},
203 /* 35 */ {0x002A, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
205 /* 36 */ {0x002A, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_1
},
206 // plus sign, question mark, unmapped
207 /* 37 */ {0x002B, 0x003F, 0x0000, DomCode::MINUS
, VKEY_OEM_PLUS
},
208 // plus sign, question mark, reverse solidus
209 /* 38 */ {0x002B, 0x003F, 0x005C, DomCode::MINUS
, VKEY_OEM_MINUS
},
210 // plus sign, question mark, o double acute
211 /* 39 */ {0x002B, 0x003F, 0x0151, DomCode::MINUS
, VKEY_OEM_PLUS
},
213 /* 40 */ {0x002B, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
215 /* 41 */ {0x002B, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_PLUS
},
217 /* 42 */ {0x002B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_PLUS
},
219 /* 43 */ {0x002B, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
221 /* 44 */ {0x002B, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_PLUS
},
223 /* 45 */ {0x002B, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_PLUS
},
225 /* 46 */ {0x002C, 0x2460, 0x2461, DomCode::COMMA
, VKEY_OEM_COMMA
},
227 /* 47 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT3
, VKEY_3
},
229 /* 48 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT5
, VKEY_5
},
231 /* 49 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
233 /* 50 */ {0x002C, 0x2460, 0x2461, DomCode::DIGIT9
, VKEY_9
},
235 /* 51 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_M
, VKEY_OEM_COMMA
},
237 /* 52 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_V
, VKEY_OEM_COMMA
},
239 /* 53 */ {0x002C, 0x2460, 0x2461, DomCode::KEY_W
, VKEY_OEM_COMMA
},
240 // hyphen-minus, equals sign, *
241 /* 54 */ {0x002D, 0x003D, 0x2461, DomCode::SLASH
, VKEY_OEM_MINUS
},
242 // hyphen-minus, low line, unmapped
243 /* 55 */ {0x002D, 0x005F, 0x0000, DomCode::EQUAL
, VKEY_OEM_MINUS
},
244 // hyphen-minus, low line, unmapped
245 /* 56 */ {0x002D, 0x005F, 0x0000, DomCode::SLASH
, VKEY_OEM_MINUS
},
246 // hyphen-minus, low line, asterisk
247 /* 57 */ {0x002D, 0x005F, 0x002A, DomCode::SLASH
, VKEY_OEM_MINUS
},
248 // hyphen-minus, low line, solidus
249 /* 58 */ {0x002D, 0x005F, 0x002F, DomCode::SLASH
, VKEY_OEM_2
},
250 // hyphen-minus, low line, n
251 /* 59 */ {0x002D, 0x005F, 0x006E, DomCode::SLASH
, VKEY_OEM_MINUS
},
252 // hyphen-minus, low line, r cedilla
253 /* 60 */ {0x002D, 0x005F, 0x0157, DomCode::EQUAL
, VKEY_OEM_4
},
254 // hyphen-minus, *, *
255 /* 61 */ {0x002D, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
256 // hyphen-minus, *, *
257 /* 62 */ {0x002D, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
258 // hyphen-minus, *, *
259 /* 63 */ {0x002D, 0x2460, 0x2461, DomCode::KEY_A
, VKEY_OEM_MINUS
},
260 // hyphen-minus, *, *
261 /* 64 */ {0x002D, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_MINUS
},
262 // hyphen-minus, *, *
263 /* 65 */ {0x002D, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_MINUS
},
265 /* 66 */ {0x002E, 0x2460, 0x2461, DomCode::DIGIT7
, VKEY_7
},
267 /* 67 */ {0x002E, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
269 /* 68 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_E
, VKEY_OEM_PERIOD
},
271 /* 69 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_O
, VKEY_OEM_PERIOD
},
273 /* 70 */ {0x002E, 0x2460, 0x2461, DomCode::KEY_R
, VKEY_OEM_PERIOD
},
275 /* 71 */ {0x002E, 0x2460, 0x2461, DomCode::PERIOD
, VKEY_OEM_PERIOD
},
277 /* 72 */ {0x002E, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
279 /* 73 */ {0x002E, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_2
},
280 // solidus, digit zero, *
281 /* 74 */ {0x002F, 0x0030, 0x2461, DomCode::DIGIT0
, VKEY_0
},
282 // solidus, digit three, *
283 /* 75 */ {0x002F, 0x0033, 0x2461, DomCode::DIGIT3
, VKEY_3
},
284 // solidus, question mark, *
285 /* 76 */ {0x002F, 0x003F, 0x2461, DomCode::DIGIT0
, VKEY_OEM_2
},
286 // solidus, question mark, *
287 /* 77 */ {0x002F, 0x003F, 0x2461, DomCode::DIGIT3
, VKEY_OEM_2
},
289 /* 78 */ {0x002F, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_7
},
291 /* 79 */ {0x002F, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
293 /* 80 */ {0x002F, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_2
},
295 /* 81 */ {0x002F, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_4
},
297 /* 82 */ {0x002F, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_2
},
299 /* 83 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
301 /* 84 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT5
, VKEY_5
},
303 /* 85 */ {0x003A, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
305 /* 86 */ {0x003A, 0x2460, 0x2461, DomCode::PERIOD
, VKEY_OEM_2
},
307 /* 87 */ {0x003B, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_3
},
309 /* 88 */ {0x003B, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_1
},
311 /* 89 */ {0x003B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
313 /* 90 */ {0x003B, 0x2460, 0x2461, DomCode::COMMA
, VKEY_OEM_PERIOD
},
315 /* 91 */ {0x003B, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
317 /* 92 */ {0x003B, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
319 /* 93 */ {0x003B, 0x2460, 0x2461, DomCode::KEY_Q
, VKEY_OEM_1
},
321 /* 94 */ {0x003B, 0x2460, 0x2461, DomCode::KEY_Z
, VKEY_OEM_1
},
323 /* 95 */ {0x003B, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
325 /* 96 */ {0x003B, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_2
},
326 // less-than sign, *, *
327 /* 97 */ {0x003C, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
328 // equals sign, percent sign, unmapped
329 /* 98 */ {0x003D, 0x0025, 0x0000, DomCode::MINUS
, VKEY_OEM_PLUS
},
330 // equals sign, percent sign, hyphen-minus
331 /* 99 */ {0x003D, 0x0025, 0x002D, DomCode::MINUS
, VKEY_OEM_MINUS
},
332 // equals sign, percent sign, *
333 /* 100 */ {0x003D, 0x0025, 0x2461, DomCode::SLASH
, VKEY_OEM_8
},
334 // equals sign, plus sign, *
335 /* 101 */ {0x003D, 0x002B, 0x2461, DomCode::SLASH
, VKEY_OEM_PLUS
},
337 /* 102 */ {0x003D, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_PLUS
},
339 /* 103 */ {0x003D, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
341 /* 104 */ {0x003D, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_PLUS
},
342 // question mark, *, *
343 /* 105 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
344 // question mark, *, *
345 /* 106 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT7
, VKEY_7
},
346 // question mark, *, *
347 /* 107 */ {0x003F, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
348 // question mark, *, *
349 /* 108 */ {0x003F, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_PLUS
},
350 // commercial at, *, *
351 /* 109 */ {0x0040, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_7
},
352 // commercial at, *, *
353 /* 110 */ {0x0040, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
354 // left square bracket, *, *
355 /* 111 */ {0x005B, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
356 // left square bracket, *, *
357 /* 112 */ {0x005B, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
358 // left square bracket, *, *
359 /* 113 */ {0x005B, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_OEM_4
},
360 // left square bracket, *, *
361 /* 114 */ {0x005B, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_4
},
362 // left square bracket, *, *
363 /* 115 */ {0x005B, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
364 // reverse solidus, solidus, *
365 /* 116 */ {0x005C, 0x002F, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_7
},
366 // reverse solidus, vertical line, digit one
367 /* 117 */ {0x005C, 0x007C, 0x0031, DomCode::BACKQUOTE
, VKEY_OEM_5
},
368 // reverse solidus, vertical line, N cedilla
369 /* 118 */ {0x005C, 0x007C, 0x0145, DomCode::BACKQUOTE
, VKEY_OEM_3
},
370 // reverse solidus, vertical line, *
371 /* 119 */ {0x005C, 0x007C, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
372 // reverse solidus, *, *
373 /* 120 */ {0x005C, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_4
},
374 // right square bracket, *, *
375 /* 121 */ {0x005D, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_3
},
376 // right square bracket, *, *
377 /* 122 */ {0x005D, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
378 // right square bracket, *, *
379 /* 123 */ {0x005D, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
380 // right square bracket, *, *
381 /* 124 */ {0x005D, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_OEM_6
},
382 // right square bracket, *, *
383 /* 125 */ {0x005D, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_6
},
385 /* 126 */ {0x005F, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
387 /* 127 */ {0x005F, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_MINUS
},
388 // grave accent, unmapped, *
389 /* 128 */ {0x0060, 0x0000, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_3
},
390 // grave accent, tilde, unmapped
391 /* 129 */ {0x0060, 0x007E, 0x0000, DomCode::BACKQUOTE
, VKEY_OEM_3
},
392 // grave accent, tilde, digit one
393 /* 130 */ {0x0060, 0x007E, 0x0031, DomCode::BACKQUOTE
, VKEY_OEM_3
},
394 // grave accent, tilde, semicolon
395 /* 131 */ {0x0060, 0x007E, 0x003B, DomCode::BACKQUOTE
, VKEY_OEM_3
},
396 // grave accent, tilde, grave accent
397 /* 132 */ {0x0060, 0x007E, 0x0060, DomCode::BACKQUOTE
, VKEY_OEM_3
},
398 // grave accent, tilde, inverted question mark
399 /* 133 */ {0x0060, 0x007E, 0x00BF, DomCode::BACKQUOTE
, VKEY_OEM_3
},
400 // grave accent, tilde, o double acute
401 /* 134 */ {0x0060, 0x007E, 0x0151, DomCode::BACKQUOTE
, VKEY_OEM_3
},
402 // grave accent, not sign, *
403 /* 135 */ {0x0060, 0x00AC, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_8
},
404 // left curly bracket, *, *
405 /* 136 */ {0x007B, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_7
},
406 // vertical line, *, *
407 /* 137 */ {0x007C, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
408 // right curly bracket, *, *
409 /* 138 */ {0x007D, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_2
},
411 /* 139 */ {0x007E, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
412 // inverted exclamation mark, *, *
413 /* 140 */ {0x00A1, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
414 // section sign, degree sign, *
415 /* 141 */ {0x00A7, 0x00B0, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_2
},
416 // section sign, vulgar fraction one half, *
417 /* 142 */ {0x00A7, 0x00BD, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_5
},
418 // section sign, *, *
419 /* 143 */ {0x00A7, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
420 // section sign, *, *
421 /* 144 */ {0x00A7, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
422 // section sign, *, *
423 /* 145 */ {0x00A7, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
424 // left-pointing double angle quotation mark, *, *
425 /* 146 */ {0x00AB, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
426 // left-pointing double angle quotation mark, *, *
427 /* 147 */ {0x00AB, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_6
},
429 /* 148 */ {0x00AD, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
431 /* 149 */ {0x00B0, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_7
},
433 /* 150 */ {0x00B0, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_2
},
434 // superscript two, *, *
435 /* 151 */ {0x00B2, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_7
},
437 /* 152 */ {0x00B5, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
438 // masculine ordinal indicator, *, *
439 /* 153 */ {0x00BA, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_OEM_5
},
440 // masculine ordinal indicator, *, *
441 /* 154 */ {0x00BA, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
442 // right-pointing double angle quotation mark, *, *
443 /* 155 */ {0x00BB, 0x2460, 0x2461, DomCode::NONE
, VKEY_9
},
444 // vulgar fraction one half, *, *
445 /* 156 */ {0x00BD, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
446 // inverted question mark, *, *
447 /* 157 */ {0x00BF, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
449 /* 158 */ {0x00DF, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
450 // a grave, degree sign, *
451 /* 159 */ {0x00E0, 0x00B0, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
452 // a grave, a diaeresis, *
453 /* 160 */ {0x00E0, 0x00E4, 0x2461, DomCode::QUOTE
, VKEY_OEM_5
},
455 /* 161 */ {0x00E0, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
457 /* 162 */ {0x00E0, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_0
},
459 /* 163 */ {0x00E1, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
461 /* 164 */ {0x00E1, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
462 // a circumflex, *, *
463 /* 165 */ {0x00E2, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
464 // a circumflex, *, *
465 /* 166 */ {0x00E2, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
466 // a diaeresis, A diaeresis, unmapped
467 /* 167 */ {0x00E4, 0x00C4, 0x0000, DomCode::QUOTE
, VKEY_OEM_7
},
468 // a diaeresis, A diaeresis, r caron
469 /* 168 */ {0x00E4, 0x00C4, 0x0159, DomCode::QUOTE
, VKEY_OEM_7
},
470 // a diaeresis, A diaeresis, S acute
471 /* 169 */ {0x00E4, 0x00C4, 0x015A, DomCode::QUOTE
, VKEY_OEM_7
},
472 // a diaeresis, a grave, *
473 /* 170 */ {0x00E4, 0x00E0, 0x2461, DomCode::QUOTE
, VKEY_OEM_5
},
475 /* 171 */ {0x00E4, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
476 // a ring above, *, *
477 /* 172 */ {0x00E5, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
479 /* 173 */ {0x00E6, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
481 /* 174 */ {0x00E6, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_3
},
482 // c cedilla, C cedilla, unmapped
483 /* 175 */ {0x00E7, 0x00C7, 0x0000, DomCode::SEMICOLON
, VKEY_OEM_1
},
484 // c cedilla, C cedilla, Thorn
485 /* 176 */ {0x00E7, 0x00C7, 0x00DE, DomCode::SEMICOLON
, VKEY_OEM_3
},
487 /* 177 */ {0x00E7, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
489 /* 178 */ {0x00E7, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
491 /* 179 */ {0x00E7, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
493 /* 180 */ {0x00E7, 0x2460, 0x2461, DomCode::COMMA
, VKEY_OEM_COMMA
},
495 /* 181 */ {0x00E7, 0x2460, 0x2461, DomCode::DIGIT9
, VKEY_9
},
497 /* 182 */ {0x00E7, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
499 /* 183 */ {0x00E8, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_1
},
501 /* 184 */ {0x00E8, 0x2460, 0x2461, DomCode::DIGIT7
, VKEY_7
},
503 /* 185 */ {0x00E8, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_3
},
504 // e acute, E acute, *
505 /* 186 */ {0x00E9, 0x00C9, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
506 // e acute, o diaeresis, *
507 /* 187 */ {0x00E9, 0x00F6, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_7
},
509 /* 188 */ {0x00E9, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_0
},
511 /* 189 */ {0x00E9, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
513 /* 190 */ {0x00E9, 0x2460, 0x2461, DomCode::SLASH
, VKEY_OEM_2
},
514 // e circumflex, *, *
515 /* 191 */ {0x00EA, 0x2460, 0x2461, DomCode::NONE
, VKEY_3
},
517 /* 192 */ {0x00EB, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_1
},
519 /* 193 */ {0x00EC, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
521 /* 194 */ {0x00ED, 0x2460, 0x2461, DomCode::BACKQUOTE
, VKEY_0
},
523 /* 195 */ {0x00ED, 0x2460, 0x2461, DomCode::DIGIT9
, VKEY_9
},
524 // i circumflex, *, *
525 /* 196 */ {0x00EE, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
527 /* 197 */ {0x00F0, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_6
},
529 /* 198 */ {0x00F0, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_1
},
531 /* 199 */ {0x00F1, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
533 /* 200 */ {0x00F2, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
535 /* 201 */ {0x00F3, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
537 /* 202 */ {0x00F3, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_PLUS
},
538 // o circumflex, *, *
539 /* 203 */ {0x00F4, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
540 // o circumflex, *, *
541 /* 204 */ {0x00F4, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
543 /* 205 */ {0x00F5, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
544 // o diaeresis, O diaeresis, unmapped
545 /* 206 */ {0x00F6, 0x00D6, 0x0000, DomCode::SEMICOLON
, VKEY_OEM_3
},
546 // o diaeresis, O diaeresis, T cedilla
547 /* 207 */ {0x00F6, 0x00D6, 0x0162, DomCode::SEMICOLON
, VKEY_OEM_3
},
548 // o diaeresis, e acute, *
549 /* 208 */ {0x00F6, 0x00E9, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_7
},
551 /* 209 */ {0x00F6, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
553 /* 210 */ {0x00F6, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_OEM_3
},
555 /* 211 */ {0x00F6, 0x2460, 0x2461, DomCode::MINUS
, VKEY_OEM_PLUS
},
556 // division sign, *, *
557 /* 212 */ {0x00F7, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
559 /* 213 */ {0x00F8, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
561 /* 214 */ {0x00F8, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_3
},
563 /* 215 */ {0x00F9, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
565 /* 216 */ {0x00F9, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_3
},
567 /* 217 */ {0x00FA, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
569 /* 218 */ {0x00FA, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
570 // u diaeresis, U diaeresis, unmapped
571 /* 219 */ {0x00FC, 0x00DC, 0x0000, DomCode::BRACKET_LEFT
, VKEY_OEM_1
},
572 // u diaeresis, U diaeresis, unmapped
573 /* 220 */ {0x00FC, 0x00DC, 0x0000, DomCode::MINUS
, VKEY_OEM_2
},
574 // u diaeresis, U diaeresis, L stroke
575 /* 221 */ {0x00FC, 0x00DC, 0x0141, DomCode::BRACKET_LEFT
, VKEY_OEM_3
},
576 // u diaeresis, e grave, *
577 /* 222 */ {0x00FC, 0x00E8, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_1
},
579 /* 223 */ {0x00FC, 0x2460, 0x2461, DomCode::KEY_W
, VKEY_W
},
581 /* 224 */ {0x00FD, 0x2460, 0x2461, DomCode::NONE
, VKEY_7
},
583 /* 225 */ {0x00FE, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_MINUS
},
585 /* 226 */ {0x0101, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_8
},
587 /* 227 */ {0x0103, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
589 /* 228 */ {0x0103, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
591 /* 229 */ {0x0105, 0x2460, 0x2461, DomCode::DIGIT1
, VKEY_1
},
593 /* 230 */ {0x0105, 0x2460, 0x2461, DomCode::KEY_Q
, VKEY_Q
},
595 /* 231 */ {0x0105, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
597 /* 232 */ {0x0107, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_7
},
599 /* 233 */ {0x010B, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
601 /* 234 */ {0x010D, 0x2460, 0x2461, DomCode::COMMA
, VKEY_OEM_COMMA
},
603 /* 235 */ {0x010D, 0x2460, 0x2461, DomCode::DIGIT2
, VKEY_2
},
605 /* 236 */ {0x010D, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
607 /* 237 */ {0x010D, 0x2460, 0x2461, DomCode::KEY_P
, VKEY_X
},
609 /* 238 */ {0x010D, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
611 /* 239 */ {0x0111, 0x2460, 0x2461, DomCode::BRACKET_RIGHT
, VKEY_OEM_6
},
613 /* 240 */ {0x0111, 0x2460, 0x2461, DomCode::DIGIT0
, VKEY_0
},
615 /* 241 */ {0x0113, 0x2460, 0x2461, DomCode::NONE
, VKEY_W
},
617 /* 242 */ {0x0117, 0x2460, 0x2461, DomCode::DIGIT4
, VKEY_4
},
619 /* 243 */ {0x0117, 0x2460, 0x2461, DomCode::QUOTE
, VKEY_OEM_7
},
620 // e ogonek, E ogonek, unmapped
621 /* 244 */ {0x0119, 0x0118, 0x0000, DomCode::SLASH
, VKEY_OEM_MINUS
},
622 // e ogonek, E ogonek, n
623 /* 245 */ {0x0119, 0x0118, 0x006E, DomCode::SLASH
, VKEY_OEM_2
},
625 /* 246 */ {0x0119, 0x2460, 0x2461, DomCode::DIGIT3
, VKEY_3
},
627 /* 247 */ {0x011B, 0x2460, 0x2461, DomCode::NONE
, VKEY_2
},
629 /* 248 */ {0x011F, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
631 /* 249 */ {0x0121, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
633 /* 250 */ {0x0127, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
635 /* 251 */ {0x012B, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
636 // i ogonek, I ogonek, unmapped
637 /* 252 */ {0x012F, 0x012E, 0x0000, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
639 /* 253 */ {0x012F, 0x2460, 0x2461, DomCode::DIGIT5
, VKEY_5
},
641 /* 254 */ {0x0131, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_1
},
643 /* 255 */ {0x0137, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
645 /* 256 */ {0x013C, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_2
},
647 /* 257 */ {0x013E, 0x2460, 0x2461, DomCode::NONE
, VKEY_2
},
649 /* 258 */ {0x0142, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_2
},
651 /* 259 */ {0x0142, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
653 /* 260 */ {0x0146, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
655 /* 261 */ {0x0148, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
656 // o double acute, *, *
657 /* 262 */ {0x0151, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
659 /* 263 */ {0x0159, 0x2460, 0x2461, DomCode::NONE
, VKEY_5
},
661 /* 264 */ {0x015F, 0x2460, 0x2461, DomCode::PERIOD
, VKEY_OEM_PERIOD
},
663 /* 265 */ {0x015F, 0x2460, 0x2461, DomCode::SEMICOLON
, VKEY_OEM_1
},
665 /* 266 */ {0x0161, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
667 /* 267 */ {0x0161, 0x2460, 0x2461, DomCode::DIGIT3
, VKEY_3
},
669 /* 268 */ {0x0161, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
671 /* 269 */ {0x0161, 0x2460, 0x2461, DomCode::KEY_A
, VKEY_OEM_1
},
673 /* 270 */ {0x0161, 0x2460, 0x2461, DomCode::KEY_F
, VKEY_F
},
675 /* 271 */ {0x0161, 0x2460, 0x2461, DomCode::PERIOD
, VKEY_OEM_PERIOD
},
677 /* 272 */ {0x0163, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_7
},
679 /* 273 */ {0x0165, 0x2460, 0x2461, DomCode::NONE
, VKEY_5
},
681 /* 274 */ {0x016B, 0x2460, 0x2461, DomCode::DIGIT8
, VKEY_8
},
683 /* 275 */ {0x016B, 0x2460, 0x2461, DomCode::KEY_Q
, VKEY_Q
},
685 /* 276 */ {0x016B, 0x2460, 0x2461, DomCode::KEY_X
, VKEY_X
},
686 // u ring above, *, *
687 /* 277 */ {0x016F, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_1
},
688 // u double acute, *, *
689 /* 278 */ {0x0171, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_5
},
690 // u ogonek, U ogonek, unmapped
691 /* 279 */ {0x0173, 0x0172, 0x0000, DomCode::SEMICOLON
, VKEY_OEM_3
},
692 // u ogonek, U ogonek, T cedilla
693 /* 280 */ {0x0173, 0x0172, 0x0162, DomCode::SEMICOLON
, VKEY_OEM_1
},
695 /* 281 */ {0x0173, 0x2460, 0x2461, DomCode::DIGIT7
, VKEY_7
},
697 /* 282 */ {0x017C, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
699 /* 283 */ {0x017C, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_OEM_4
},
701 /* 284 */ {0x017E, 0x2460, 0x2461, DomCode::BACKSLASH
, VKEY_OEM_5
},
703 /* 285 */ {0x017E, 0x2460, 0x2461, DomCode::BRACKET_LEFT
, VKEY_Y
},
705 /* 286 */ {0x017E, 0x2460, 0x2461, DomCode::DIGIT6
, VKEY_6
},
707 /* 287 */ {0x017E, 0x2460, 0x2461, DomCode::EQUAL
, VKEY_OEM_PLUS
},
709 /* 288 */ {0x017E, 0x2460, 0x2461, DomCode::KEY_W
, VKEY_W
},
711 /* 289 */ {0x01A1, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
713 /* 290 */ {0x01B0, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_4
},
715 /* 291 */ {0x01B6, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_6
},
717 /* 292 */ {0x0259, 0x2460, 0x2461, DomCode::NONE
, VKEY_OEM_3
},
719 // Simple alphanumeric cases.
720 /* 293 */ {'a', 'A', '?', DomCode::NONE
, VKEY_A
},
721 /* 294 */ {'z', 'Z', '!', DomCode::NONE
, VKEY_Z
},
722 /* 295 */ {'9', '(', '+', DomCode::NONE
, VKEY_9
},
723 /* 296 */ {'0', ')', '-', DomCode::NONE
, VKEY_0
},
726 for (size_t i
= 0; i
< arraysize(kVkeyTestCase
); ++i
) {
728 const VkTestXkbKeyboardLayoutEngine::Entry
* e
= &kVkeyTestCase
[i
];
729 layout_engine_
->SetEntry(e
);
731 // Test with predetermined plain character.
732 KeyboardCode key_code
= layout_engine_
->GetKeyboardCode(
733 e
->dom_code
, EF_NONE
, e
->plain_character
);
734 EXPECT_EQ(e
->key_code
, key_code
);
736 if (e
->shift_character
) {
737 // Test with predetermined shifted character.
738 key_code
= layout_engine_
->GetKeyboardCode(e
->dom_code
, EF_SHIFT_DOWN
,
740 EXPECT_EQ(e
->key_code
, key_code
);
743 if (e
->altgr_character
) {
744 // Test with predetermined AltGr character.
745 key_code
= layout_engine_
->GetKeyboardCode(e
->dom_code
, EF_ALTGR_DOWN
,
747 EXPECT_EQ(e
->key_code
, key_code
);
750 // Test with unrelated predetermined character.
752 layout_engine_
->GetKeyboardCode(e
->dom_code
, EF_MOD3_DOWN
, 0xFFFFu
);
753 EXPECT_EQ(e
->key_code
, key_code
);
757 TEST_F(XkbLayoutEngineVkTest
, XkbRuleNamesForLayoutName
) {
758 static const VkTestXkbKeyboardLayoutEngine::RuleNames kVkeyTestCase
[] = {
759 /* 0 */ {"us", "us", ""},
760 /* 1 */ {"jp", "jp", ""},
761 /* 2 */ {"us(intl)", "us", "intl"},
762 /* 3 */ {"us(altgr-intl)", "us", "altgr-intl"},
763 /* 4 */ {"us(dvorak)", "us", "dvorak"},
764 /* 5 */ {"us(colemak)", "us", "colemak"},
765 /* 6 */ {"be", "be", ""},
766 /* 7 */ {"fr", "fr", ""},
767 /* 8 */ {"ca", "ca", ""},
768 /* 9 */ {"ch(fr)", "ch", "fr"},
769 /* 10 */ {"ca(multix)", "ca", "multix"},
770 /* 11 */ {"de", "de", ""},
771 /* 12 */ {"de(neo)", "de", "neo"},
772 /* 13 */ {"ch", "ch", ""},
773 /* 14 */ {"ru", "ru", ""},
774 /* 15 */ {"ru(phonetic)", "ru", "phonetic"},
775 /* 16 */ {"br", "br", ""},
776 /* 17 */ {"bg", "bg", ""},
777 /* 18 */ {"bg(phonetic)", "bg", "phonetic"},
778 /* 19 */ {"ca(eng)", "ca", "eng"},
779 /* 20 */ {"cz", "cz", ""},
780 /* 21 */ {"cz(qwerty)", "cz", "qwerty"},
781 /* 22 */ {"ee", "ee", ""},
782 /* 23 */ {"es", "es", ""},
783 /* 24 */ {"es(cat)", "es", "cat"},
784 /* 25 */ {"dk", "dk", ""},
785 /* 26 */ {"gr", "gr", ""},
786 /* 27 */ {"il", "il", ""},
787 /* 28 */ {"latam", "latam", ""},
788 /* 29 */ {"lt", "lt", ""},
789 /* 30 */ {"lv(apostrophe)", "lv", "apostrophe"},
790 /* 31 */ {"hr", "hr", ""},
791 /* 32 */ {"gb(extd)", "gb", "extd"},
792 /* 33 */ {"gb(dvorak)", "gb", "dvorak"},
793 /* 34 */ {"fi", "fi", ""},
794 /* 35 */ {"hu", "hu", ""},
795 /* 36 */ {"it", "it", ""},
796 /* 37 */ {"is", "is", ""},
797 /* 38 */ {"no", "no", ""},
798 /* 39 */ {"pl", "pl", ""},
799 /* 40 */ {"pt", "pt", ""},
800 /* 41 */ {"ro", "ro", ""},
801 /* 42 */ {"se", "se", ""},
802 /* 43 */ {"sk", "sk", ""},
803 /* 44 */ {"si", "si", ""},
804 /* 45 */ {"rs", "rs", ""},
805 /* 46 */ {"tr", "tr", ""},
806 /* 47 */ {"ua", "ua", ""},
807 /* 48 */ {"by", "by", ""},
808 /* 49 */ {"am", "am", ""},
809 /* 50 */ {"ge", "ge", ""},
810 /* 51 */ {"mn", "mn", ""},
811 /* 52 */ {"ie", "ie", ""}};
812 for (size_t i
= 0; i
< arraysize(kVkeyTestCase
); ++i
) {
814 const VkTestXkbKeyboardLayoutEngine::RuleNames
* e
= &kVkeyTestCase
[i
];
815 std::string layout_id
;
816 std::string layout_variant
;
817 XkbKeyboardLayoutEngine::ParseLayoutName(e
->layout_name
, &layout_id
,
819 EXPECT_EQ(layout_id
, e
->layout
);
820 EXPECT_EQ(layout_variant
, e
->variant
);