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

Unified Diff: chrome/browser/global_keyboard_shortcuts_mac_unittest.mm

Issue 2535553002: MacViews: Fix GlobalKeyboardShortcuts.ShortcutsToWindowCommand. (Closed)
Patch Set: #ifdef out failing test. Created 4 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 | « no previous file | 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.mm
diff --git a/chrome/browser/global_keyboard_shortcuts_mac_unittest.mm b/chrome/browser/global_keyboard_shortcuts_mac_unittest.mm
index 25b261dd2763aeda54cf7aa793de68d4561e2bb1..896d16149fe048ff3c459f55a345e09d4447e3e5 100644
--- a/chrome/browser/global_keyboard_shortcuts_mac_unittest.mm
+++ b/chrome/browser/global_keyboard_shortcuts_mac_unittest.mm
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "chrome/app/chrome_command_ids.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/ui_features.h"
TEST(GlobalKeyboardShortcuts, ShortcutsToWindowCommand) {
// Test that an invalid shortcut translates into an invalid command id.
@@ -44,10 +45,17 @@ TEST(GlobalKeyboardShortcuts, ShortcutsToWindowCommand) {
EXPECT_EQ(IDC_SELECT_PREVIOUS_TAB, CommandForWindowKeyboardShortcut(
true, false, false, true, kVK_ANSI_8, '{'));
+ // On MacViews the IDC_SELECT_TAB_0 accelerator is mapped via the
+ // accelerator_table.cc, which supports mapping using only using keycodes.
+ // The only reason CommandForWindowKeyboardShortcut is necessary on MacViews
+ // is to handle the Cmd-'{' and Cmd-'}', and it doesn't need to handle
+ // IDC_SELECT_TAB_0, so this test could be omitted.
+#if !BUILDFLAG(MAC_VIEWS_BROWSER)
// Test that switching tabs triggers off keycodes and not characters (visible
// with the Italian keyboard layout).
EXPECT_EQ(IDC_SELECT_TAB_0, CommandForWindowKeyboardShortcut(
true, false, false, false, kVK_ANSI_1, '&'));
+#endif // !BUILDFLAG(MAC_VIEWS_BROWSER)
}
TEST(GlobalKeyboardShortcuts, KeypadNumberKeysMatch) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698