Commit c309e929 authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Enable AcceleratorTest.GetShortcutText For Android

Adding support in ui::Accelerator::GetShortcutText fixes this test.

BUG=

Change-Id: I93dea9bcf2c662a4d63d3d4afab1f9c43fca039c
Reviewed-on: https://chromium-review.googlesource.com/c/1345072Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610770}
parent e1563537
......@@ -15,6 +15,7 @@
#include "build/build_config.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/keyboard_code_conversion.h"
#include "ui/strings/grit/ui_strings.h"
#if defined(OS_WIN)
......@@ -161,7 +162,7 @@ base::string16 Accelerator::GetShortcutText() const {
else
key = LOWORD(::MapVirtualKeyW(key_code_, MAPVK_VK_TO_CHAR));
shortcut += key;
#elif defined(USE_AURA) || defined(OS_MACOSX)
#elif defined(USE_AURA) || defined(OS_MACOSX) || defined(OS_ANDROID)
const uint16_t c = DomCodeToUsLayoutCharacter(
UsLayoutKeyboardCodeToDomCode(key_code_), false);
if (c != 0)
......
......@@ -35,13 +35,7 @@ TEST(AcceleratorTest, TimeStamp) {
EXPECT_EQ(event_time, accelerator_b.time_stamp());
}
#if defined(OS_ANDROID)
// Keyboard shortcuts don't have meaningful text on Android.
#define MAYBE_GetShortcutText DISABLED_GetShortcutText
#else
#define MAYBE_GetShortcutText GetShortcutText
#endif
TEST(AcceleratorTest, MAYBE_GetShortcutText) {
TEST(AcceleratorTest, GetShortcutText) {
struct {
KeyboardCode code;
int modifiers;
......
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