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

Unified Diff: ui/base/keycodes/usb_keycode_map_unittest.cc

Issue 12320014: Switch Pepper Linux to use shared USB<->native key conversion table. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missed kInvalidKeycode. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/keycodes/usb_keycode_map.h ('k') | webkit/plugins/ppapi/usb_key_code_conversion_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/keycodes/usb_keycode_map_unittest.cc
diff --git a/ui/base/keycodes/usb_keycode_map_unittest.cc b/ui/base/keycodes/usb_keycode_map_unittest.cc
index add2edff1fa910e6e89e362c80d19059a9b61adb..09e4258c335bd3faa5260994fcf2b595206a6c05 100644
--- a/ui/base/keycodes/usb_keycode_map_unittest.cc
+++ b/ui/base/keycodes/usb_keycode_map_unittest.cc
@@ -25,22 +25,21 @@ const size_t kExpectedMappedKeyCount = 0;
#include "ui/base/keycodes/usb_keycode_map.h"
#undef USB_KEYMAP
-const uint32_t kUsbInvalidKeycode = 0x000000;
const uint32_t kUsbNonExistentKeycode = 0xffffff;
const uint32_t kUsbUsBackslash = 0x070031;
const uint32_t kUsbNonUsHash = 0x070032;
TEST(UsbKeycodeMap, Basic) {
// Verify that the first element in the table is the "invalid" code.
- EXPECT_EQ(kUsbInvalidKeycode, usb_keycode_map[0].usb_keycode);
- EXPECT_EQ(kInvalidKeycode, usb_keycode_map[0].native_keycode);
+ EXPECT_EQ(InvalidUsbKeycode(), usb_keycode_map[0].usb_keycode);
+ EXPECT_EQ(InvalidNativeKeycode(), usb_keycode_map[0].native_keycode);
// Verify that there are no duplicate entries in the mapping.
std::map<uint32_t, uint16_t> usb_to_native;
std::map<uint16_t, uint32_t> native_to_usb;
for (size_t i = 0; i < arraysize(usb_keycode_map); ++i) {
// Don't test keys with no native keycode mapping on this platform.
- if (usb_keycode_map[i].native_keycode == kInvalidKeycode)
+ if (usb_keycode_map[i].native_keycode == InvalidNativeKeycode())
continue;
// Verify UsbKeycodeToNativeKeycode works for this key.
@@ -78,7 +77,8 @@ TEST(UsbKeycodeMap, Basic) {
TEST(UsbKeycodeMap, NonExistent) {
// Verify that UsbKeycodeToNativeKeycode works for a non-existent USB keycode.
- EXPECT_EQ(kInvalidKeycode, UsbKeycodeToNativeKeycode(kUsbNonExistentKeycode));
+ EXPECT_EQ(InvalidNativeKeycode(),
+ UsbKeycodeToNativeKeycode(kUsbNonExistentKeycode));
}
TEST(UsbKeycodeMap, UsBackslashIsNonUsHash) {
« no previous file with comments | « ui/base/keycodes/usb_keycode_map.h ('k') | webkit/plugins/ppapi/usb_key_code_conversion_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698