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

Issue 856313003: Mac: Refine ui_controls_mac's SynthesizeKeyEvent() (Closed)

Created:
5 years, 11 months ago by tapted
Modified:
5 years, 11 months ago
Reviewers:
Nico
CC:
chromium-reviews, jdduke+watch_chromium.org, tdresser+watch_chromium.org, chrome-apps-syd-reviews_chromium.org, mac-views-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: Refine ui_controls_mac's SynthesizeKeyEvent() In preparation for moving SynthesizeKeyEvent to cocoa_test_event_utils, this refines the behavior of SynthesizeKeyEvent to more closely match actual events. There were two bugs: The unichar character being set on a simulated "Delete" key was actually the unichar that Mac uses for "Backspace" (0x7f). Cocoa actually uses 0xf728 for the delete key (NSDeleteFunctionKey). Note "Backspace" stays sending 0x8 (Ctrl+H) rather than being updated to 0x7f (ASCII DEL). Either seems to work for Backspace (which meant simulated Deletes were becoming deleteBackward action messages rather than deleteForward). Also, SynthesizeKeyEvent is updated to closely follow the behavior on Mac wrt Command/Shift modifiers. The bug here was that when *just* Shift+letter is pressed, characters and charactersIgnoringModifiers should *both* be uppercase. (r311815 swapped them for Ctrl, but didn't try to fix Shift). These changes are needed for comprehensive testing of views::TextField on Mac. Specifically, to get TextfieldTest.ControlAndSelectTest and TextfieldTest.ControlAndSelectTest passing with simulated NSEvents. BUG=378134 Committed: https://crrev.com/c3217c83c5638ee9f4669628003b68df6694a02f Cr-Commit-Position: refs/heads/master@{#313441}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -16 lines) Patch
M ui/base/test/ui_controls_mac.mm View 2 chunks +30 lines, -15 lines 0 comments Download
M ui/events/keycodes/keyboard_code_conversion_mac.mm View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (2 generated)
tapted
Hi Nico - please take a look. I also want to move SynthesizeKeyEvent() out of ...
5 years, 11 months ago (2015-01-27 07:43:33 UTC) #2
Nico
lgtm given that backspace on web contents still goes back (no idea if that goes ...
5 years, 11 months ago (2015-01-27 18:55:15 UTC) #3
tapted
On 2015/01/27 18:55:15, Nico wrote: > lgtm given that backspace on web contents still goes ...
5 years, 11 months ago (2015-01-28 00:56:33 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/856313003/1
5 years, 11 months ago (2015-01-28 01:27:38 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 11 months ago (2015-01-28 04:20:57 UTC) #7
commit-bot: I haz the power
5 years, 11 months ago (2015-01-28 04:22:51 UTC) #8
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/c3217c83c5638ee9f4669628003b68df6694a02f
Cr-Commit-Position: refs/heads/master@{#313441}

Powered by Google App Engine
This is Rietveld 408576698