Bug 221466 - Allow sending modifier keys in test_driver.send_keys()
Summary: Allow sending modifier keys in test_driver.send_keys()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Manuel Rego Casasnovas
URL:
Keywords: InRadar
Depends on: 221456
Blocks:
  Show dependency treegraph
 
Reported: 2021-02-05 07:53 PST by Manuel Rego Casasnovas
Modified: 2021-03-02 13:48 PST (History)
6 users (show)

See Also:


Attachments
Test case (677 bytes, text/html)
2021-02-05 07:53 PST, Manuel Rego Casasnovas
no flags Details
Patch (5.45 KB, patch)
2021-02-08 02:32 PST, Manuel Rego Casasnovas
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (5.51 KB, patch)
2021-02-08 09:19 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch (7.87 KB, patch)
2021-02-08 21:53 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff
Patch (8.12 KB, patch)
2021-02-08 21:59 PST, Manuel Rego Casasnovas
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>