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

Side by Side Diff: ui/events/keycodes/dom4/keycode_converter_unittest.cc

Issue 1061733002: Remove windows/mac/ios specific code from //ui (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: fix default try set Created 5 years, 8 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/dom4/keycode_converter.h" 5 #include "ui/events/keycodes/dom4/keycode_converter.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 11
12 using ui::KeycodeConverter; 12 using ui::KeycodeConverter;
13 13
14 namespace { 14 namespace {
15 15
16 #if defined(OS_WIN) 16 #if defined(OS_LINUX)
17 const size_t kExpectedMappedKeyCount = 138;
18 #elif defined(OS_LINUX)
19 const size_t kExpectedMappedKeyCount = 145; 17 const size_t kExpectedMappedKeyCount = 145;
20 #elif defined(OS_MACOSX)
21 const size_t kExpectedMappedKeyCount = 118;
22 #else 18 #else
23 const size_t kExpectedMappedKeyCount = 0; 19 const size_t kExpectedMappedKeyCount = 0;
24 #endif 20 #endif
25 21
26 const uint32_t kUsbNonExistentKeycode = 0xffffff; 22 const uint32_t kUsbNonExistentKeycode = 0xffffff;
27 const uint32_t kUsbUsBackslash = 0x070031; 23 const uint32_t kUsbUsBackslash = 0x070031;
28 const uint32_t kUsbNonUsHash = 0x070032; 24 const uint32_t kUsbNonUsHash = 0x070032;
29 25
30 TEST(UsbKeycodeMap, Basic) { 26 TEST(UsbKeycodeMap, Basic) {
31 // Verify that the first element in the table is the "invalid" code. 27 // Verify that the first element in the table is the "invalid" code.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 99 }
104 100
105 TEST(UsbKeycodeMap, UsBackslashIsNonUsHash) { 101 TEST(UsbKeycodeMap, UsBackslashIsNonUsHash) {
106 // Verify that UsbKeycodeToNativeKeycode treats the non-US "hash" key 102 // Verify that UsbKeycodeToNativeKeycode treats the non-US "hash" key
107 // as equivalent to the US "backslash" key. 103 // as equivalent to the US "backslash" key.
108 EXPECT_EQ(ui::KeycodeConverter::UsbKeycodeToNativeKeycode(kUsbUsBackslash), 104 EXPECT_EQ(ui::KeycodeConverter::UsbKeycodeToNativeKeycode(kUsbUsBackslash),
109 ui::KeycodeConverter::UsbKeycodeToNativeKeycode(kUsbNonUsHash)); 105 ui::KeycodeConverter::UsbKeycodeToNativeKeycode(kUsbNonUsHash));
110 } 106 }
111 107
112 } // namespace 108 } // namespace
OLDNEW
« no previous file with comments | « ui/events/keycodes/dom4/keycode_converter.cc ('k') | ui/events/platform/platform_event_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698