WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
https://bugs.webkit.org/show_bug.cgi?id=180350
Reviewed by Carlos Alberto Lopez Perez.
Source/WebDriver:
Stop handling the empty string as a special case of evaluateJavaScriptFunction result.
* Session.cpp:
(WebDriver::Session::executeScript):
Source/WebKit:
undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
case to return an empty string. We currently handle this case for execute script commands, but not in all other
cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
because in that case we wouldn't need to handle it as a special case.
15.2 Executing Script
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone
Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent
* WebProcess/Automation/WebAutomationSessionProxy.js:
(let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227773
268f45cc-cd09-0410-ab3c-
d52691b4dbfc