Bug 1672551 [wpt PR 26183] - webdriver: handle events with Unidentified key code, a=testonly

Automatic update from web-platform-tests
webdriver: handle events with Unidentified key code (#26183)

WebKit sets the event key code as Unidentified as per the spec (see
https://www.w3.org/TR/uievents-code/), but WebDriver tests expect an
empty string for the case of unidentified key codes. This patch changes
the code to an empty string when Unidentified is found.
--

wpt-commits: b57da97fc05e5440ae675027dd45a26be48e2dbd
wpt-pr: 26183
This commit is contained in:
Carlos Garcia Campos 2020-10-24 10:40:43 +00:00 коммит произвёл moz-wptsync-bot
Родитель 2063f6957e
Коммит a8103d41a0
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -9,6 +9,11 @@ def get_events(session):
key = e["key"]
hex_suffix = key[key.index("+") + 1:]
e["key"] = unichr(int(hex_suffix, 16))
# WebKit sets code as 'Unidentified' for unidentified key codes, but
# tests expect ''.
if "code" in e and e["code"] == "Unidentified":
e["code"] = ""
return events