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

Unified Diff: content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm

Issue 2309253006: [Mac] Map ContextMenu key to corresponding DomKey and keyCode (Closed)
Patch Set: dtapuska's review, remove unnecessary debug info Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/events/keycodes/keyboard_code_conversion_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm
diff --git a/content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm b/content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm
index b92531859d9859d9b96037708eceef457841ca4e..0a0114551ae2901fcb28b2170be6297071b6dc93 100644
--- a/content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm
+++ b/content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm
@@ -563,6 +563,19 @@ TEST(WebInputEventBuilderMacTest, DomKeyFlagsChanged) {
}
}
+TEST(WebInputEventBuilderMacTest, ContextMenuKey) {
+ // Context menu is not defined but shows up as 0x6E.
+ const int kVK_ContextMenu = 0x6E;
+
+ const NSEventType kEventTypeToTest[] = {NSKeyDown, NSKeyUp};
+ for (auto flags : kEventTypeToTest) {
+ NSEvent* mac_event = BuildFakeKeyEvent(kVK_ContextMenu, 0, 0, flags);
+ WebKeyboardEvent web_event = WebKeyboardEventBuilder::Build(mac_event);
+ EXPECT_EQ(ui::DomKey::CONTEXT_MENU, web_event.domKey);
+ EXPECT_EQ(ui::VKEY_APPS, web_event.windowsKeyCode);
+ }
+}
+
// Flaky - https://crbug.com/640457
// Test that a ui::Event and blink::WebInputEvent made from the same NSEvent
// have the same values for comparable fields.
« no previous file with comments | « no previous file | ui/events/keycodes/keyboard_code_conversion_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698