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

Unified Diff: chrome/browser/global_keyboard_shortcuts_mac_unittest.mm

Issue 2074643003: MacViews: Views accelerators table should match the Cocoa one. (Closed) Base URL: ssh://bitbucket.browser.yandex-team.ru/chromium/src.git@master
Patch Set: Fix compilation. Created 4 years, 1 month 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
Index: chrome/browser/global_keyboard_shortcuts_mac_unittest.mm
diff --git a/chrome/browser/global_keyboard_shortcuts_mac_unittest.mm b/chrome/browser/global_keyboard_shortcuts_mac_unittest.mm
index df0e4ebe0d67c6df30db2bdf563051e4ae51158e..25b261dd2763aeda54cf7aa793de68d4561e2bb1 100644
--- a/chrome/browser/global_keyboard_shortcuts_mac_unittest.mm
+++ b/chrome/browser/global_keyboard_shortcuts_mac_unittest.mm
@@ -18,15 +18,11 @@ TEST(GlobalKeyboardShortcuts, ShortcutsToWindowCommand) {
-1, CommandForWindowKeyboardShortcut(false, false, false, false, 0, 0));
// Check that all known keyboard shortcuts return valid results.
- size_t num_shortcuts = 0;
- const KeyboardShortcutData *it =
- GetWindowKeyboardShortcutTable(&num_shortcuts);
- ASSERT_GT(num_shortcuts, 0U);
- for (size_t i = 0; i < num_shortcuts; ++i, ++it) {
+ for (const auto& shortcut : GetWindowKeyboardShortcutTable()) {
int cmd_num = CommandForWindowKeyboardShortcut(
- it->command_key, it->shift_key, it->cntrl_key, it->opt_key,
- it->vkey_code, it->key_char);
- EXPECT_EQ(cmd_num, it->chrome_command);
+ shortcut.command_key, shortcut.shift_key, shortcut.cntrl_key,
+ shortcut.opt_key, shortcut.vkey_code, shortcut.key_char);
+ EXPECT_EQ(cmd_num, shortcut.chrome_command);
}
// Test that cmd-left and backspace are not window-level commands (else they
@@ -110,15 +106,11 @@ TEST(GlobalKeyboardShortcuts, ShortcutsToDelayedWindowCommand) {
0, 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) {
+ for (const auto& shortcut : GetDelayedWindowKeyboardShortcutTable()) {
int cmd_num = CommandForDelayedWindowKeyboardShortcut(
- it->command_key, it->shift_key, it->cntrl_key, it->opt_key,
- it->vkey_code, it->key_char);
- EXPECT_EQ(cmd_num, it->chrome_command);
+ shortcut.command_key, shortcut.shift_key, shortcut.cntrl_key,
+ shortcut.opt_key, shortcut.vkey_code, shortcut.key_char);
+ EXPECT_EQ(cmd_num, shortcut.chrome_command);
}
}
@@ -129,15 +121,11 @@ TEST(GlobalKeyboardShortcuts, ShortcutsToBrowserCommand) {
0, 0));
// Check that all known keyboard shortcuts return valid results.
- size_t num_shortcuts = 0;
- const KeyboardShortcutData *it =
- GetBrowserKeyboardShortcutTable(&num_shortcuts);
- ASSERT_GT(num_shortcuts, 0U);
- for (size_t i = 0; i < num_shortcuts; ++i, ++it) {
+ for (const auto& shortcut : GetBrowserKeyboardShortcutTable()) {
int cmd_num = CommandForBrowserKeyboardShortcut(
- it->command_key, it->shift_key, it->cntrl_key, it->opt_key,
- it->vkey_code, it->key_char);
- EXPECT_EQ(cmd_num, it->chrome_command);
+ shortcut.command_key, shortcut.shift_key, shortcut.cntrl_key,
+ shortcut.opt_key, shortcut.vkey_code, shortcut.key_char);
+ EXPECT_EQ(cmd_num, shortcut.chrome_command);
}
}
« no previous file with comments | « chrome/browser/global_keyboard_shortcuts_mac.mm ('k') | chrome/browser/global_keyboard_shortcuts_views_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698