Closed Bug 936204 Opened 11 years ago Closed 7 years ago

Import atoms as separate files to avoid tight coupling to Selenium

Categories

(Remote Protocol :: Marionette, enhancement)

x86_64
Linux
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: ato, Unassigned)

Details

(Keywords: pi-marionette-server)

The WebDriver atoms are individually compiled to separate .js files in Selenium, called “fragments”.  Because the Marionette protocol isn't identical to WebDriver's wire protocol, Selenium needs to know to which functions in the different atoms match to so that it can generate the file we use in testing/marionette/atoms/atoms.js.

This isn't ideal because it introduces a tight coupling between Mozilla's repository and Selenium's.  Instead Marionette should be importing the relevant fragments directly so that no upstream patches are needed if Marionette decides to change its protocol.

My suggestion is that we also avoid concatenating the atoms into one file as that adds a further manipulation step on our side, and also do the function assignment inside Firefox.  I'm not sure what the performance impact of packaging and importing multiple files from the JAR would be.
For reference I wrote a patch for Selenium to generate testing/marionette/atoms/atoms.js as it's currently set up to work; one file in which all atom fragments are concatenated and assigned a function name: https://code.google.com/p/selenium/source/detail?r=2f47941a58fb7bec448f6492a3d2b478c2f0a8c4

This lets us easily update the atoms we rely on from Selenium, but can be changed later to accommodate multiple atom fragment files if necessary.

To generate fresh atoms from the Selenium repo, do the following:

    ./go marionette:atoms
    cp build/javascript/marionette/atoms.js $MOZILLA/src/testing/marionette/atoms/atoms.js

The list of atoms is defined in Rakefile in the root directory of the Selenium repo.
As we are implementing the WebDriver standard, we want to get rid of testing/marionette/atom.js altogether.  The work on this is being tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1354203.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.