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

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: 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..90a86f97f9c10096f0b51f562ed4e365c9fe600b 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,20 @@ 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) << web_event.domKey;
dtapuska 2016/09/07 17:53:25 I don't think you need the "<< web_event.domKey" o
+ EXPECT_EQ(ui::VKEY_APPS, web_event.windowsKeyCode)
+ << 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