Closed Bug 2084105 Opened 1 month ago Closed 1 month ago

script.callFunction should throw "invalid argument" when passed an argument with an unknown type

Categories

(Remote Protocol :: WebDriver BiDi, defect, P3)

defect
Points:
2

Tracking

(firefox161 fixed)

RESOLVED FIXED
161 Branch
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.callFunction with { 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: nobody → jdescottes
Status: NEW → ASSIGNED
Severity: -- → S3
Points: --- → 2
Priority: -- → P3
Whiteboard: [webdriver:m22]
Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/63f90da2ab1f https://hg.mozilla.org/integration/autoland/rev/a2c39525069f [bidi] Throw invalid argument when deserializing a local value with an unknown type r=webdriver-reviewers,whimboo https://github.com/mozilla-firefox/firefox/commit/e5d0735ea912 https://hg.mozilla.org/integration/autoland/rev/a1c8c8324da2 [wdspec] Add tests for script.callFunction with unknown local value types r=webdriver-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/64281 for changes under testing/web-platform/tests

Whiteboard: [webdriver:m22] → [webdriver:m22], [wptsync upstream]

Upstream PR merged by moz-wptsync-bot

Whiteboard: [webdriver:m22], [wptsync upstream] → [webdriver:m22][wptsync upstream][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: