Closed Bug 1746595 Opened 3 years ago Closed 3 years ago

Throw unknown command error when calling an unexpected bidi command

Categories

(Remote Protocol :: WebDriver BiDi, task, P2)

task
Points:
2

Tracking

(firefox97 fixed)

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

(Whiteboard: [bidi-m3-mvp], [wptsync upstream])

Attachments

(2 files)

From https://bugzilla.mozilla.org/show_bug.cgi?id=1731576#c15

(In reply to James Graham [:jgraham] from Bug 1731576 comment #15)

From a spec perspective this will respond with an unknown command error, see https://w3c.github.io/webdriver-bidi/#handle-an-incoming-message.

I think we want to be able to write tests that check that we handle unknown commands correctly without always having logspam, so it might make sense to change the way we log in this case.

Right now, when an unsupported command is called, the message handler will throw an internal error "UnsupportedCommandError" https://searchfox.org/mozilla-central/rev/5e15e00fa247cba5b765727496619bf9010ed162/remote/shared/messagehandler/Errors.jsm#72

We should translate this to a webdriver error "UnknownCommandError" https://searchfox.org/mozilla-central/rev/5e15e00fa247cba5b765727496619bf9010ed162/remote/shared/webdriver/Errors.jsm#497

This can probably be handled in webdriver/Session.jsm https://searchfox.org/mozilla-central/rev/5e15e00fa247cba5b765727496619bf9010ed162/remote/shared/webdriver/Session.jsm#223

wdspec tests should be added to check that we throw the expected error.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Points: --- → 2
Priority: -- → P2
Whiteboard: [webdriver:triage] → [bidi-m3-mvp]
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/77ffa849a6d2 [bidi] Throw unknown command error when calling an unexpected bidi command adn Summary: r=webdriver-reviewers,whimboo https://hg.mozilla.org/integration/autoland/rev/37149f29af6d [wdspec] Add wdspec tests for unknown command error r=webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/32145 for changes under testing/web-platform/tests
Whiteboard: [bidi-m3-mvp] → [bidi-m3-mvp], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: