Commit 4ffb0e22 authored by mblsha's avatar mblsha Committed by Commit bot

MacViews: Fix GlobalKeyboardShortcuts.ShortcutsToWindowCommand.

After crbug.com/620315 global_keyboard_shortcuts_mac.mm uses two different
shortcut tables: one for Cocoa and one for MacViews. Ensure that the test works
on both browser implementations.

BUG=620315

Review-Url: https://codereview.chromium.org/2535553002
Cr-Commit-Position: refs/heads/master@{#436169}
parent a82fdc00
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment