Title: [268858] trunk
- Revision
- 268858
- Author
- [email protected]
- Date
- 2020-10-22 02:42:22 -0700 (Thu, 22 Oct 2020)
Log 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.
* TestExpectations.json:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (268857 => 268858)
--- trunk/Source/WebKit/ChangeLog 2020-10-22 09:36:08 UTC (rev 268857)
+++ trunk/Source/WebKit/ChangeLog 2020-10-22 09:42:22 UTC (rev 268858)
@@ -1,3 +1,23 @@
+2020-10-22 Carlos Garcia Campos <[email protected]>
+
+ 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.
+
+ 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.
+
2020-10-21 Ryosuke Niwa <[email protected]>
Move function definitions in JSIPCBinding.h into cpp file
Modified: trunk/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h (268857 => 268858)
--- trunk/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h 2020-10-22 09:36:08 UTC (rev 268857)
+++ trunk/Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.h 2020-10-22 09:42:22 UTC (rev 268858)
@@ -58,7 +58,7 @@
using KeyboardInteraction = Inspector::Protocol::Automation::KeyboardInteractionType;
using VirtualKey = Inspector::Protocol::Automation::VirtualKey;
using VirtualKeyMap = HashMap<VirtualKey, VirtualKey, WTF::IntHash<VirtualKey>, WTF::StrongEnumHashTraits<VirtualKey>>;
-using CharKey = char; // For WebDriver, this only needs to support ASCII characters on 102-key keyboard.
+using CharKey = UChar32;
using MouseButton = Inspector::Protocol::Automation::MouseButton;
using MouseInteraction = Inspector::Protocol::Automation::MouseInteraction;
using MouseMoveOrigin = Inspector::Protocol::Automation::MouseMoveOrigin;
Modified: trunk/Source/WebKit/UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp (268857 => 268858)
--- trunk/Source/WebKit/UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp 2020-10-22 09:36:08 UTC (rev 268857)
+++ trunk/Source/WebKit/UIProcess/Automation/gtk/WebAutomationSessionGtk.cpp 2020-10-22 09:42:22 UTC (rev 268858)
@@ -293,7 +293,7 @@
keyCode = keyCodeForVirtualKey(virtualKey);
},
[&] (CharKey charKey) {
- keyCode = gdk_unicode_to_keyval(g_utf8_get_char(&charKey));
+ keyCode = gdk_unicode_to_keyval(charKey);
}
);
unsigned modifiers = modifiersForKeyCode(keyCode);
Modified: trunk/Source/WebKit/UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp (268857 => 268858)
--- trunk/Source/WebKit/UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp 2020-10-22 09:36:08 UTC (rev 268857)
+++ trunk/Source/WebKit/UIProcess/Automation/wpe/WebAutomationSessionWPE.cpp 2020-10-22 09:42:22 UTC (rev 268858)
@@ -333,7 +333,7 @@
keyCode = keyCodeForVirtualKey(virtualKey);
},
[&] (CharKey charKey) {
- keyCode = wpe_unicode_to_key_code(g_utf8_get_char(&charKey));
+ keyCode = wpe_unicode_to_key_code(charKey);
}
);
uint32_t modifiers = modifiersForKeyCode(keyCode);
Modified: trunk/WebDriverTests/ChangeLog (268857 => 268858)
--- trunk/WebDriverTests/ChangeLog 2020-10-22 09:36:08 UTC (rev 268857)
+++ trunk/WebDriverTests/ChangeLog 2020-10-22 09:42:22 UTC (rev 268858)
@@ -1,5 +1,16 @@
2020-10-22 Carlos Garcia Campos <[email protected]>
+ 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.
+
+ Remove expectations for tests that are now passing.
+
+ * TestExpectations.json:
+
+2020-10-22 Carlos Garcia Campos <[email protected]>
+
Unreviewed. Update W3C WebDriver imported tests.
* TestExpectations.json:
Modified: trunk/WebDriverTests/TestExpectations.json (268857 => 268858)
--- trunk/WebDriverTests/TestExpectations.json 2020-10-22 09:36:08 UTC (rev 268857)
+++ trunk/WebDriverTests/TestExpectations.json 2020-10-22 09:42:22 UTC (rev 268858)
@@ -362,18 +362,6 @@
"test_modifier_key_sends_correct_events[\\ue053-R_META]": {
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
},
- "test_printable_key_sends_correct_events[\\xe0-]": {
- "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
- },
- "test_printable_key_sends_correct_events[\\u0416-]": {
- "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
- },
- "test_printable_key_sends_correct_events[\\u2603-]": {
- "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
- },
- "test_printable_key_sends_correct_events[\\uf6c2-]": {
- "expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
- },
"test_special_key_sends_keydown[META-expected30]": {
"expected": {"all": {"status": ["FAIL"], "bug": "webkit.org/b/184967"}}
},
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes