script.callFunction should throw "invalid argument" when passed an argument with an unknown type
Categories
(Remote Protocol :: WebDriver BiDi, defect, P3)
Tracking
(firefox161 fixed)
| Tracking | Status | |
|---|---|---|
| firefox161 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
Details
(Whiteboard: [webdriver:m22][wptsync upstream][webdriver:relnote])
Attachments
(2 external files)
When an object in the arguments or this parameter of script.callFunction has an unknown type (for example {"type": "foo"}), the spec says to return an invalid argument error. See the "otherwise" branch of "deserialize local value":
https://w3c.github.io/webdriver-bidi/#deserialize-local-value
In Firefox, deserialize() in remote/webdriver-bidi/RemoteValue.sys.mjs only logs a warning ("Unsupported type for local value") and returns undefined. So the function is called with undefined for that argument, and the command succeeds. The same happens for nested values, for example an item of an array or set, or a key or value of an object or map.
Steps to reproduce:
- Send
script.callFunctionwith{ functionDeclaration: "(arg) => typeof arg", arguments: [{"type": "foo"}], awaitPromise: false, target: <valid target> }
ER: invalid argument error.
AR: a success response with the string "undefined".
| Assignee | ||
Comment 1•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
| Assignee | ||
Updated•1 month ago
|
Comment 4•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a2c39525069f
https://hg.mozilla.org/mozilla-central/rev/a1c8c8324da2
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/64281 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Updated•12 days ago
|
Description
•