• John Chen's avatar
    [ChromeDriver] Fix issues in keyboard actions · 1ee5d1e6
    John Chen authored
    Fixing various issues in the implementation of keyboard actions, including:
    * Proper handling of modifier keys.
    * Use W3C spec compliant codes and names for keys.
    * Setting key location property.
    * Keeping track of key presses between multiple actions.
    
    Most of the logic is in ConvertKeyActionToKeyEvent function, which was
    based on ConvertKeysToKeyEvents function for legacy (non action based)
    keyboard support.
    
    ChromeDriver now passes most WPT test cases for keyboard actions
    (webdriver/tests/perform_actions/key*.py), except:
    * 4 failures in key_special_keys.py, because Unicode characters
      above U+FFFF and grapheme clusters are not yet supported.
    * 7 failures in key_events.py, due to inconsistency in "code for key"
      table in W3C spec (https://github.com/w3c/webdriver/pull/1384).
    * 4 failures in key_events.py, because Chrome refers to the Meta keys
      as MetaLeft and MetaRight, while WPT names them OSLeft and OSRight.
    
    Bug: chromedriver:1897
    Change-Id: Icaf9fff81c7e8127a849699f90871d8d24af4dfa
    Reviewed-on: https://chromium-review.googlesource.com/c/1392056Reviewed-by: default avatarLan Wei <lanwei@chromium.org>
    Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
    Commit-Queue: John Chen <johnchen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#619480}
    1ee5d1e6
window_commands.cc 74.9 KB