Closed Bug 1111282 Opened 10 years ago Closed 7 years ago

Make MarionetteServerConnection.sessionCapabilities immutable

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ato, Unassigned)

Details

(Keywords: pi-marionette-server)

After the introduction of MarionetteServerConnection.setSessionCapabilities (internal method) we should consider making the sessionCapabilities member immutable, or in JS vernacular, “frozen”:

    this.sessionCapabilities = Object.freeze(caps);

This would affect the this.sessionCapabiltiies.B2G = true workaround we have in getSessionCapabilities, but the way that is currently coded can easily be considered a bug.

Doing this will force anyone interacting with the capabilities to go through setSessionCapabilities, which as far as I understand would be desired as there are more changes to come to the specification in this area.
Flags: needinfo?(dburns)
Need info for?
Flags: needinfo?(dburns)
Since you've done the work on session capabilities I'd like to hear your input on whether this is a good idea or not.  I don't fully understand the implementation in setSessionCapabilities and what it aims to achieve.
Flags: needinfo?(dburns)
Session Capabilities are the equivalent to WebDriver's desired capabilities. Currently when newSession is called it calls setSessionCapabilites that updates a common object that everything should have access to if they need to check anything in there.

I am happy to make it immutable but since nothing from the client side can access this I don't see it being a high priority at the moment.
Flags: needinfo?(dburns)
Thanks.  Yes, it would purely be an internal security measure.
is this still required with the work done around session.js?
Flags: needinfo?(ato)
Not required I don’t think.
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(ato)
Resolution: --- → WONTFIX
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.