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

Side by Side Diff: ui/events/keycodes/platform_key_map_win_unittest.cc

Issue 2630213003: Return AltGraph for right-Alt keydown/keyup, under layouts which use AltGraph. (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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/keycodes/platform_key_map_win.h" 5 #include "ui/events/keycodes/platform_key_map_win.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/events/event_constants.h" 10 #include "ui/events/event_constants.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 for (const auto& test_case : kJapaneseTestCases) { 319 for (const auto& test_case : kJapaneseTestCases) {
320 EXPECT_EQ(test_case.us_key, DomKeyFromKeyboardCodeImpl( 320 EXPECT_EQ(test_case.us_key, DomKeyFromKeyboardCodeImpl(
321 us_keymap, test_case.key_code, EF_NONE)) 321 us_keymap, test_case.key_code, EF_NONE))
322 << test_case.key_code; 322 << test_case.key_code;
323 EXPECT_EQ(test_case.jp_key, DomKeyFromKeyboardCodeImpl( 323 EXPECT_EQ(test_case.jp_key, DomKeyFromKeyboardCodeImpl(
324 jp_keymap, test_case.key_code, EF_NONE)) 324 jp_keymap, test_case.key_code, EF_NONE))
325 << test_case.key_code; 325 << test_case.key_code;
326 } 326 }
327 } 327 }
328 328
329 TEST_F(PlatformKeyMapTest, AltGraph) {
330 PlatformKeyMap us_keymap(
331 GetPlatformKeyboardLayout(KEYBOARD_LAYOUT_ENGLISH_US));
332 EXPECT_EQ(DomKey::ALT,
333 DomKeyFromKeyboardCodeImpl(us_keymap, VKEY_MENU, EF_ALTGR_DOWN));
334 EXPECT_EQ(DomKey::ALT,
335 DomKeyFromKeyboardCodeImpl(us_keymap, VKEY_MENU,
336 EF_ALTGR_DOWN | EF_IS_EXTENDED_KEY));
337
338 PlatformKeyMap fr_keymap(GetPlatformKeyboardLayout(KEYBOARD_LAYOUT_FRENCH));
339 EXPECT_EQ(DomKey::ALT,
340 DomKeyFromKeyboardCodeImpl(fr_keymap, VKEY_MENU, EF_ALTGR_DOWN));
341 EXPECT_EQ(DomKey::ALT_GRAPH,
342 DomKeyFromKeyboardCodeImpl(fr_keymap, VKEY_MENU,
343 EF_ALTGR_DOWN | EF_IS_EXTENDED_KEY));
344 }
345
329 } // namespace ui 346 } // namespace ui
OLDNEW
« ui/events/keycodes/platform_key_map_win.cc ('K') | « ui/events/keycodes/platform_key_map_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698