Bug 1525126 Comment 47 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #45)

> The underlying reason is that webdriver sets the `browserName` capability for capability matching:
> 
> https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/firefox.js#L266
> 
> > this.setBrowserName(Browser.FIREFOX);
> 
> As such the exact same value is returned in the capabilities sent
> by Marionette back to geckodriver. Given that in case of geckoview
> the `Services.appinfo.name` is `Fennec`, we seem to force keeping
> the incoming capability value in the returned capabilities even it
> doesn't match at all.

Bear in mind that Marionette does not do any capabilities matching.
It treats the capabilities passed to `WebDriver:NewSession` as
configuration, and runs only rudimentary type- and bounds checks
to ensure the sanity of the data.

Marionette picks up on the data it needs to configure itself and
assumes the remaining data is correct:
https://searchfox.org/mozilla-central/rev/588814f2edddf0e132d77d326ddae50911e8bad1/testing/marionette/capabilities.js#585

I think perhaps there’s a case that `Capabilities._match()` shouldn’t
write everything back on `matched`.
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #45)

> The underlying reason is that webdriver sets the `browserName` capability for capability matching:
> 
> https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/firefox.js#L266
> 
> > this.setBrowserName(Browser.FIREFOX);
> 
> As such the exact same value is returned in the capabilities sent
> by Marionette back to geckodriver. Given that in case of geckoview
> the `Services.appinfo.name` is `Fennec`, we seem to force keeping
> the incoming capability value in the returned capabilities even it
> doesn't match at all.

Bear in mind that Marionette does not do any capabilities matching.
It treats the capabilities passed to `WebDriver:NewSession` as
configuration, and runs only rudimentary type- and bounds checks
to ensure the sanity of the data.

Marionette picks up on the data it needs to configure itself and
assumes the remaining data is correct:
https://searchfox.org/mozilla-central/rev/588814f2edddf0e132d77d326ddae50911e8bad1/testing/marionette/capabilities.js#585

I think perhaps there’s an argument that Marionette should only
care for the specific capabilities it needs for setting various
options, and ignore any additional stuff passed on by geckodriver.
This would let the original value for `browserName` from
`Services.appinfo.name` to be passed back:
https://searchfox.org/mozilla-central/rev/588814f2edddf0e132d77d326ddae50911e8bad1/testing/marionette/capabilities.js#438
writing everything back on `matched`

Back to Bug 1525126 Comment 47