Bug 221466

Summary: Allow sending modifier keys in test_driver.send_keys()
Product: WebKit Reporter: Manuel Rego Casasnovas <rego>
Component: Tools / TestsAssignee: Manuel Rego Casasnovas <rego>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, cgarcia, clopez, ews-watchlist, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/27526
https://bugs.webkit.org/show_bug.cgi?id=222615
Bug Depends on: 221456    
Bug Blocks:    
Attachments:
Description Flags
Test case
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch none

Description Manuel Rego Casasnovas 2021-02-05 07:53:31 PST
Created attachment 419407 [details]
Test case

Check the attached example, if you run it as a WPT test:
  Tools/Scripts/run-webkit-tests --gtk LayoutTests/imported/w3c/web-platform-tests/uievents/send-ctrl-key.html

It will fail because it'll get "Unidentified" instead of "Control" in event.key.
Comment 1 Manuel Rego Casasnovas 2021-02-08 00:58:01 PST
This might be due to the FIXME in: https://webkit-search.igalia.com/webkit/source/LayoutTests/imported/w3c/web-platform-tests/resources/testdriver-vendor.js#157
    // FIXME: Add more cases.
    const SeleniumCharCodeToEventSenderKey = {
        0xE003: 'delete',
        0xE004: '\t',
        0xE00D: ' ',
        0xE012: 'leftArrow',
        0xE013: 'upArrow',
        0xE014: 'rightArrow',
        0xE015: 'downArrow',
    };

Right now it only understands a few char codes.
Comment 2 Manuel Rego Casasnovas 2021-02-08 02:32:52 PST
Created attachment 419569 [details]
Patch
Comment 3 EWS Watchlist 2021-02-08 02:33:39 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 4 Manuel Rego Casasnovas 2021-02-08 02:40:55 PST
I've to export the WPT test before landing (for some reason the script failed), but I want to check in the bots first here.
Comment 5 Manuel Rego Casasnovas 2021-02-08 09:19:21 PST
Created attachment 419598 [details]
Patch
Comment 6 Manuel Rego Casasnovas 2021-02-08 09:42:31 PST
The test has been exported to https://github.com/web-platform-tests/wpt/pull/27526 and passes now in Chromium and Firefox, and also in GTK with this patch.

Probably it's going to fail on Mac so I'd add the proper expectations. Anyway the patch is ready to be reviewed I believe.
Comment 7 Manuel Rego Casasnovas 2021-02-08 21:53:55 PST
Created attachment 419675 [details]
Patch
Comment 8 Manuel Rego Casasnovas 2021-02-08 21:59:45 PST
Created attachment 419677 [details]
Patch
Comment 9 EWS 2021-02-09 02:34:31 PST
Committed r272572: <https://commits.webkit.org/r272572>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 419677 [details].
Comment 10 Radar WebKit Bug Importer 2021-02-09 02:35:13 PST
<rdar://problem/74135384>