Closed Bug 1453289 Opened 6 years ago Closed 6 years ago

Capabilities property in listener.js uses invalid "Marionette:WebDriver:GetCapabilities" command

Categories

(Remote Protocol :: Marionette, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: whimboo, Unassigned)

Details

The listener.js script has a `capabilities` property set, which is using an invalid command with the name "Marionette:WebDriver:GetCapabilities":

https://dxr.mozilla.org/mozilla-central/rev/0a2dae2d8cf9f628c55668514c54a23da446d5de/testing/marionette/listener.js#68-74

Andreas, I assume this should be "Marionette:GetCapabilities" while driver lists it as "WebDriver:GetCapabilities". I don't see that as part of the spec, and wonder that nothing is broken due to that.
Flags: needinfo?
Marionette:WebDriver:GetCapabilities is an message listener registered
in testing/marionette/driver.js that returns the capabilities object,
so this is working as expected.
Flags: needinfo?
Shouldn't that message listener be called "Marionette:GetCapabilities", and "WebDriver:GetCapabilities" removed from the list of commands at the bottom of the file? I don't see that as part of the spec anywhere.
Flags: needinfo?(ato)
WebDriver:GetCapabilities is a public-facing command, whereas
Marionette:WebDriver:GetCapabilities is an internal IPC message.

The latter routes to the Marionette component’s WebDriver module’s
getCapabilities function.  So I’d say the name makes sense.  With
https://bugzilla.mozilla.org/show_bug.cgi?id=1330309 I want to move
all WebDriver related functionality into a webdriver.js file,
separate from driver.js so it makes more sense if you see it in
this perspective.
Flags: needinfo?(ato)
(In reply to Andreas Tolfsen ‹:ato› from comment #3)
> WebDriver:GetCapabilities is a public-facing command, whereas

So where is it defined in the spec and which route does it have? I cannot find any code beside the above mentioned message listener which makes use of it. Whether in Marionette client nor geckodriver.
It’s only part of the Marionette protocol, and as far as I’m aware
there’s no equivalent command for it in the WebDriver REST API.
Correct, so we should rename "WebDriver:GetCapabilities" to "Marionette:GetCapabilities" then and move it up to the other Marionette specific commands, right?
Capabilities are WebDriver related and not relevant to Marionette-specific
commands.  Its code will be living in the webdriver.js module.  So
we shouldn’t rename it because it is related to WebDriver, not
Marionette.
So what I think confuses me then is the distinction between public commands as defined by the WebDriver spec, and those we internally use like the above. Would it be ok, if we just move this command out of the public WebDriver command block, and put it into it's own? If yes, we should do the same for all the chrome scope related commands.
I don’t really see the value in that.

I’d like to stress again that Marionette _does not implement
WebDriver_, but it does provide certain WebDriver related functionality
that we use in geckodriver.  For example, neither the input nor the
output from pretty much any of the WebDriver:* prefixed commands
in testing/marionette/driver.js conform to WebDriver: many of them
take extra parameters for non-conforming behaviour and all of their
response values are incompatible.

WebDriver:GetCapabilities queries WebDriver-related data in
Marionette’s WebDriver subsystem.  When we arrive at the point of
greater modularity in Marionette it will not make sense for this
to live in a Marionette specific namespace since it internally needs
to query state that is held by the WebDriver module.  Despite the
command not being defined explicitly in the specification, it belongs
under a WebDriver:* namespace since the function it provides is
definitively related to WebDriver and the state that Marionette’s
WebDriver service would hold.
In that case lets mark as wontfix. Thanks.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.