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

Side by Side Diff: chrome/browser/global_keyboard_shortcuts_mac_unittest.cc

Issue 149325: Add facitility for Global Keyboard shortcuts. (Closed)
Patch Set: Created 11 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/global_keyboard_shortcuts_mac.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 TEST(GlobalKeyboardShortcuts, ShortCutsToCommand) {
10 // Test that an invalid shortcut translates into an invalid command id.
11 ASSERT_EQ(CommandForKeyboardShortcut(false, false, false, 0), -1);
12
13 // Check that all known keyboard shortcuts return valid results.
14 size_t num_shortcuts = 0;
15 const KeyboardShortcutData *it = GetKeyboardShortCutTable(&num_shortcuts);
16 ASSERT_GT(num_shortcuts, 0U);
17 for (size_t i = 0; i < num_shortcuts; ++i, ++it) {
18 int cmd_num = CommandForKeyboardShortcut(it->command_key, it->shift_key,
19 it->cntrl_key, it->vkey_code);
20 ASSERT_EQ(cmd_num, it->chrome_command);
21 }
22 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698