Changeset 248531 in webkit


Ignore:
Timestamp:
Aug 12, 2019 10:13:55 AM (5 years ago)
Author:
dbates@webkit.org
Message:

Add a test to ensure that we dispatch keydown and keyup events when multiple keys are pressed at the same time
https://bugs.webkit.org/show_bug.cgi?id=200548

Reviewed by Darin Adler.

Tools:

Expose infrastructure to simulate a literal raw key down and a literal key up event.

  • TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
  • TestRunnerShared/UIScriptContext/UIScriptController.h:

(WTR::UIScriptController::rawKeyDown):
(WTR::UIScriptController::rawKeyUp):

  • WebKitTestRunner/ios/UIScriptControllerIOS.h:
  • WebKitTestRunner/ios/UIScriptControllerIOS.mm:

(WTR::UIScriptControllerIOS::rawKeyDown):
(WTR::UIScriptControllerIOS::rawKeyUp):

LayoutTests:

Add a test. Skip the test for now until we have the fixes for <rdar://problem/53613454> and <rdar://problem/54001139>.

  • fast/events/ios/multiple-key-press-and-release-ordering-expected.txt: Added.
  • fast/events/ios/multiple-key-press-and-release-ordering.html: Added.
  • platform/ios/TestExpectations:
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248521 r248531  
     12019-08-12  Daniel Bates  <dabates@apple.com>
     2
     3        Add a test to ensure that we dispatch keydown and keyup events when multiple keys are pressed at the same time
     4        https://bugs.webkit.org/show_bug.cgi?id=200548
     5
     6        Reviewed by Darin Adler.
     7
     8        Add a test. Skip the test for now until we have the fixes for <rdar://problem/53613454> and <rdar://problem/54001139>.
     9
     10        * fast/events/ios/multiple-key-press-and-release-ordering-expected.txt: Added.
     11        * fast/events/ios/multiple-key-press-and-release-ordering.html: Added.
     12        * platform/ios/TestExpectations:
     13
    1142019-08-11  Alicia Boya García  <aboya@igalia.com>
    215
  • trunk/LayoutTests/platform/ios/TestExpectations

    r248468 r248531  
    33643364editing/pasteboard/paste-does-not-fire-promises-while-sanitizing-web-content.html [ Failure ]
    33653365
     3366# Skip until we have the fixes for <rdar://problem/53613454> and <rdar://problem/54001139>.
     3367fast/events/ios/multiple-key-press-and-release-ordering.html [ Skip ]
  • trunk/Tools/ChangeLog

    r248530 r248531  
     12019-08-12  Daniel Bates  <dabates@apple.com>
     2
     3        Add a test to ensure that we dispatch keydown and keyup events when multiple keys are pressed at the same time
     4        https://bugs.webkit.org/show_bug.cgi?id=200548
     5
     6        Reviewed by Darin Adler.
     7
     8        Expose infrastructure to simulate a literal raw key down and a literal key up event.
     9
     10        * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
     11        * TestRunnerShared/UIScriptContext/UIScriptController.h:
     12        (WTR::UIScriptController::rawKeyDown):
     13        (WTR::UIScriptController::rawKeyUp):
     14        * WebKitTestRunner/ios/UIScriptControllerIOS.h:
     15        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
     16        (WTR::UIScriptControllerIOS::rawKeyDown):
     17        (WTR::UIScriptControllerIOS::rawKeyUp):
     18
    1192019-08-12  Thibault Saunier  <tsaunier@igalia.com>
    220
  • trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl

    r247941 r248531  
    7474    void keyDown(DOMString character, object modifierArray);
    7575    void toggleCapsLock(object callback);
     76
     77    void rawKeyDown(DOMString key);
     78    void rawKeyUp(DOMString key);
    7679
    7780    // eventsJSON describes a series of user events in JSON form. For the keys, see HIDEventGenerator.mm.
  • trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h

    r248030 r248531  
    148148    virtual void toggleCapsLock(JSValueRef callback) { notImplemented(); }
    149149
     150    virtual void rawKeyDown(JSStringRef) { notImplemented(); }
     151    virtual void rawKeyUp(JSStringRef) { notImplemented(); }
     152
    150153    virtual void keyboardAccessoryBarNext() { notImplemented(); }
    151154    virtual void keyboardAccessoryBarPrevious() { notImplemented(); }
  • trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.h

    r247898 r248531  
    6565    void typeCharacterUsingHardwareKeyboard(JSStringRef character, JSValueRef) override;
    6666    void keyDown(JSStringRef character, JSValueRef modifierArray) override;
     67
     68    void rawKeyDown(JSStringRef) override;
     69    void rawKeyUp(JSStringRef) override;
     70
    6771    void dismissFormAccessoryView() override;
    6872    void dismissFilePicker(JSValueRef) override;
  • trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm

    r247898 r248531  
    461461}
    462462
     463void UIScriptControllerIOS::rawKeyDown(JSStringRef key)
     464{
     465    // Key can be either a single Unicode code point or the name of a special key (e.g. "downArrow").
     466    // HIDEventGenerator knows how to map these special keys to the appropriate keycode.
     467    [[HIDEventGenerator sharedHIDEventGenerator] keyDown:toWTFString(toWK(key))];
     468    [[HIDEventGenerator sharedHIDEventGenerator] sendMarkerHIDEventWithCompletionBlock:^{ /* Do nothing */ }];
     469}
     470
     471void UIScriptControllerIOS::rawKeyUp(JSStringRef key)
     472{
     473    // Key can be either a single Unicode code point or the name of a special key (e.g. "downArrow").
     474    // HIDEventGenerator knows how to map these special keys to the appropriate keycode.
     475    [[HIDEventGenerator sharedHIDEventGenerator] keyUp:toWTFString(toWK(key))];
     476    [[HIDEventGenerator sharedHIDEventGenerator] sendMarkerHIDEventWithCompletionBlock:^{ /* Do nothing */ }];
     477}
     478
    463479void UIScriptControllerIOS::keyDown(JSStringRef character, JSValueRef modifierArray)
    464480{
Note: See TracChangeset for help on using the changeset viewer.