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

Unified Diff: chrome/browser/global_keyboard_shortcuts_mac_unittest.cc

Issue 491023: Add a keyboard shortcut on Escape that emits the IDC_STOP command.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years 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 | « chrome/browser/global_keyboard_shortcuts_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/global_keyboard_shortcuts_mac_unittest.cc
===================================================================
--- chrome/browser/global_keyboard_shortcuts_mac_unittest.cc (revision 34671)
+++ chrome/browser/global_keyboard_shortcuts_mac_unittest.cc (working copy)
@@ -34,6 +34,24 @@
false, false, false, false, kVK_Delete));
}
+TEST(GlobalKeyboardShortcuts, ShortcutsToDelayedWindowCommand) {
+ // Test that an invalid shortcut translates into an invalid command id.
+ ASSERT_EQ(-1,
+ CommandForDelayedWindowKeyboardShortcut(false, false, false, false, 0));
+
+ // Check that all known keyboard shortcuts return valid results.
+ size_t num_shortcuts = 0;
+ const KeyboardShortcutData *it =
+ GetDelayedWindowKeyboardShortcutTable(&num_shortcuts);
+ ASSERT_GT(num_shortcuts, 0U);
+ for (size_t i = 0; i < num_shortcuts; ++i, ++it) {
+ int cmd_num = CommandForDelayedWindowKeyboardShortcut(
+ it->command_key, it->shift_key, it->cntrl_key, it->opt_key,
+ it->vkey_code);
+ ASSERT_EQ(cmd_num, it->chrome_command);
+ }
+}
+
TEST(GlobalKeyboardShortcuts, ShortcutsToBrowserCommand) {
// Test that an invalid shortcut translates into an invalid command id.
ASSERT_EQ(
« no previous file with comments | « chrome/browser/global_keyboard_shortcuts_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698