⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268858 in webkit


Ignore:
Timestamp:
Oct 22, 2020, 2:42:22 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

WebDriver: handle key events with non-ASCII unicode code point
https://bugs.webkit.org/show_bug.cgi?id=217950

Reviewed by Carlos Alberto Lopez Perez.

Source/WebKit:

We are assuming that key events are limited to ASCII, but they contain a unicode code point.

Fixes: imported/w3c/webdriver/tests/perform_actions/key_events.py::test_printable_key_sends_correct_events[\xe0-]

imported/w3c/webdriver/tests/perform_actions/key_events.py::test_printable_key_sends_correct_events[\u0416-]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_printable_key_sends_correct_events[\u2603-]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_printable_key_sends_correct_events[\uf6c2-]

  • UIProcess/Automation/SimulatedInputDispatcher.h: Use UChar32 instead of char for CharKey.
  • UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:

(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Handle Charkey as a unicode code point.

  • UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:

(WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Ditto.

WebDriverTests:

Remove expectations for tests that are now passing.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r268854 r268858  
     12020-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebDriver: handle key events with non-ASCII unicode code point
     4        https://bugs.webkit.org/show_bug.cgi?id=217950
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        We are assuming that key events are limited to ASCII, but they contain a unicode code point.
     9
     10        Fixes: imported/w3c/webdriver/tests/perform_actions/key_events.py::test_printable_key_sends_correct_events[\xe0-]
     11               imported/w3c/webdriver/tests/perform_actions/key_events.py::test_printable_key_sends_correct_events[\u0416-]
     12               imported/w3c/webdriver/tests/perform_actions/key_events.py::test_printable_key_sends_correct_events[\u2603-]
     13               imported/w3c/webdriver/tests/perform_actions/key_events.py::test_printable_key_sends_correct_events[\uf6c2-]
     14
     15        * UIProcess/Automation/SimulatedInputDispatcher.h: Use UChar32 instead of char for CharKey.
     16        * UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp:
     17        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Handle Charkey as a unicode code point.
     18        * UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp:
     19        (WebKit::WebAutomationSession::platformSimulateKeyboardInteraction): Ditto.
     20
    1212020-10-21  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h

    r268793 r268858  
    5959using VirtualKey = Inspector::Protocol::Automation::VirtualKey;
    6060using VirtualKeyMap = HashMap<VirtualKey, VirtualKey, WTF::IntHash<VirtualKey>, WTF::StrongEnumHashTraits<VirtualKey>>;
    61 using CharKey = char; // For WebDriver, this only needs to support ASCII characters on 102-key keyboard.
     61using CharKey = UChar32;
    6262using MouseButton = Inspector::Protocol::Automation::MouseButton;
    6363using MouseInteraction = Inspector::Protocol::Automation::MouseInteraction;
  • trunk/Source/WebKit/UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp

    r268793 r268858  
    294294        },
    295295        [&] (CharKey charKey) {
    296             keyCode = gdk_unicode_to_keyval(g_utf8_get_char(&charKey));
     296            keyCode = gdk_unicode_to_keyval(charKey);
    297297        }
    298298    );
  • trunk/Source/WebKit/UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp

    r268793 r268858  
    334334        },
    335335        [&] (CharKey charKey) {
    336             keyCode = wpe_unicode_to_key_code(g_utf8_get_char(&charKey));
     336            keyCode = wpe_unicode_to_key_code(charKey);
    337337        }
    338338    );
  • trunk/WebDriverTests/ChangeLog

    r268857 r268858  
     12020-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebDriver: handle key events with non-ASCII unicode code point
     4        https://bugs.webkit.org/show_bug.cgi?id=217950
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Remove expectations for tests that are now passing.
     9
     10        * TestExpectations.json:
     11
    1122020-10-22  Carlos Garcia Campos  <cgarcia@igalia.com>
    213
  • trunk/WebDriverTests/TestExpectations.json

    r268857 r268858  
    363363                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
    364364            },
    365             "test_printable_key_sends_correct_events[\\xe0-]": {
    366                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
    367             },
    368             "test_printable_key_sends_correct_events[\\u0416-]": {
    369                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
    370             },
    371             "test_printable_key_sends_correct_events[\\u2603-]": {
    372                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
    373             },
    374             "test_printable_key_sends_correct_events[\\uf6c2-]": {
    375                 "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
    376             },
    377365            "test_special_key_sends_keydown[META-expected30]": {
    378366                "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
Note: See TracChangeset for help on using the changeset viewer.