| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <AppKit/NSEvent.h> | 5 #include <AppKit/NSEvent.h> |
| 6 #include <Carbon/Carbon.h> | 6 #include <Carbon/Carbon.h> |
| 7 | 7 |
| 8 #include "chrome/browser/global_keyboard_shortcuts_mac.h" | 8 #include "chrome/browser/global_keyboard_shortcuts_mac.h" |
| 9 | 9 |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 {kVK_ANSI_2, kVK_ANSI_Keypad2}, | 64 {kVK_ANSI_2, kVK_ANSI_Keypad2}, |
| 65 {kVK_ANSI_3, kVK_ANSI_Keypad3}, | 65 {kVK_ANSI_3, kVK_ANSI_Keypad3}, |
| 66 {kVK_ANSI_4, kVK_ANSI_Keypad4}, | 66 {kVK_ANSI_4, kVK_ANSI_Keypad4}, |
| 67 {kVK_ANSI_5, kVK_ANSI_Keypad5}, | 67 {kVK_ANSI_5, kVK_ANSI_Keypad5}, |
| 68 {kVK_ANSI_6, kVK_ANSI_Keypad6}, | 68 {kVK_ANSI_6, kVK_ANSI_Keypad6}, |
| 69 {kVK_ANSI_7, kVK_ANSI_Keypad7}, | 69 {kVK_ANSI_7, kVK_ANSI_Keypad7}, |
| 70 {kVK_ANSI_8, kVK_ANSI_Keypad8}, | 70 {kVK_ANSI_8, kVK_ANSI_Keypad8}, |
| 71 {kVK_ANSI_9, kVK_ANSI_Keypad9}, | 71 {kVK_ANSI_9, kVK_ANSI_Keypad9}, |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 for (unsigned int i = 0; i < ARRAYSIZE_UNSAFE(equivalents); ++i) { | 74 for (unsigned int i = 0; i < arraysize(equivalents); ++i) { |
| 75 for (int command = 0; command <= 1; ++command) { | 75 for (int command = 0; command <= 1; ++command) { |
| 76 for (int shift = 0; shift <= 1; ++shift) { | 76 for (int shift = 0; shift <= 1; ++shift) { |
| 77 for (int control = 0; control <= 1; ++control) { | 77 for (int control = 0; control <= 1; ++control) { |
| 78 for (int option = 0; option <= 1; ++option) { | 78 for (int option = 0; option <= 1; ++option) { |
| 79 EXPECT_EQ( | 79 EXPECT_EQ( |
| 80 CommandForWindowKeyboardShortcut( | 80 CommandForWindowKeyboardShortcut( |
| 81 command, shift, control, option, equivalents[i].keycode, 0), | 81 command, shift, control, option, equivalents[i].keycode, 0), |
| 82 CommandForWindowKeyboardShortcut( | 82 CommandForWindowKeyboardShortcut( |
| 83 command, shift, control, option, | 83 command, shift, control, option, |
| 84 equivalents[i].keypad_keycode, 0)); | 84 equivalents[i].keypad_keycode, 0)); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // cmd-shift-'[' in an RTL context pre 10.9. | 185 // cmd-shift-'[' in an RTL context pre 10.9. |
| 186 EXPECT_EQ('{', KeyCharacterForEvent( | 186 EXPECT_EQ('{', KeyCharacterForEvent( |
| 187 KeyEvent(true, true, false, false, @"{", @"}"))); | 187 KeyEvent(true, true, false, false, @"{", @"}"))); |
| 188 // cmd-shift-'[' in an RTL context on 10.9. | 188 // cmd-shift-'[' in an RTL context on 10.9. |
| 189 EXPECT_EQ('{', KeyCharacterForEvent( | 189 EXPECT_EQ('{', KeyCharacterForEvent( |
| 190 KeyEvent(true, true, false, false, @"[", @"}"))); | 190 KeyEvent(true, true, false, false, @"[", @"}"))); |
| 191 // Test if getting dead-key events return 0 and do not hang. | 191 // Test if getting dead-key events return 0 and do not hang. |
| 192 EXPECT_EQ(0, KeyCharacterForEvent( | 192 EXPECT_EQ(0, KeyCharacterForEvent( |
| 193 KeyEvent(false, false, false, false, @"", @""))); | 193 KeyEvent(false, false, false, false, @"", @""))); |
| 194 } | 194 } |
| OLD | NEW |