Closed Bug 1821039 Opened 1 year ago Closed 1 year ago

"script.callFunction" has to fail with "no such handle" error if the handle of an object as passed as argument is unknown

Categories

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

defect

Tracking

(firefox113 fixed)

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: whimboo, Assigned: sairaabdullapa, Mentored)

References

()

Details

(Whiteboard: [webdriver:m6] [lang=js] [wptsync upstream] [webdriver:relnote])

Attachments

(2 files)

As per the WebDriver BiDi spec the handle of an object needs to be known if given. If it's not known within the given Realm, a no such handle error needs to be raised.

Right now we raise an invalid argument error instead. When fixing that we need browser chrome as well as wdspec tests.

Summary: "script.callFunction" has to fail with "no such handle" error if handle is unknown → "script.callFunction" has to fail with "no such handle" error if the handle of an object as passed as argument is unknown
Mentor: hskupin
Severity: -- → S3
Priority: -- → P3
Whiteboard: [webdriver:backlog][lang=js]

I would like to attempt this. Can you please guide me?

Sure, and thank you for your interest! In the following some information in how to get this fixed.

An example of using a handle can be found in the webdriver BiDi tests for callFunction within arguments.py. It basically means that a strong reference of a Javascript object gets created within the browser by some script evaluation, which then later on can be referred via callFunction.

Steps to do here would be:

  1. Create a new test within invalid.py right under the test test_params_arguments_handle_invalid_type and name it test_params_arguments_handle_unknown_value. Here a string value needs to be passed as handle to callFunction that is randomly set, eg. foo.

  2. Run the given test by specifying the exact path and notice that it doesn't fail with a no such handle failure but invalid argument.

  3. Fix the problem with the deserialization in RemoteValue.sys.mjs so that the correct error is thrown. It needs to behave similar as InvalidArgumentError.

  4. Ensure to also add the new error type to the WebDriver BiDi Python client so that the test can correctly assert the expected error type.

If you have questions don't hesitate to ask, or even better join us on Matrix in the webdriver channel.

Assignee: nobody → sairaabdullapa
Status: NEW → ASSIGNED
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/513e167dd843
'script.callFunction' has to fail with 'no such handle' error if the handle of an object as passed as argument is unknown. r=whimboo,webdriver-reviewers
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/39404 for changes under testing/web-platform/tests
Whiteboard: [webdriver:backlog][lang=js] → [webdriver:backlog][lang=js], [wptsync upstream]
Pushed by hskupin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3b9301f49922
[webdriver-bidi] Fix broken object handle tests in browser_RemoteValue.js. r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Upstream PR was closed without merging
Upstream PR merged by jgraham
Whiteboard: [webdriver:backlog][lang=js], [wptsync upstream] → [webdriver:backlog][lang=js], [wptsync upstream] [webdriver:relnote]
Whiteboard: [webdriver:backlog][lang=js], [wptsync upstream] [webdriver:relnote] → [webdriver:m6] [lang=js] [wptsync upstream] [webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: