|
|
| Line 1: |
Line 1: |
| = Brief Overview =
| | All Marionette information will be on [https://developer.mozilla.org/en/Marionette MDN] from now on. |
| Marionette uses the JSON Wire Protocol with support for the remote debugger protocol. It responds to commands by dispatching the requested actions to the requested targets. This is done by having Marionette be a root actor that sends our testing requests to an actor that will dispatch the requested action.
| |
| | |
| == Current Status ==
| |
| | |
| Marionette currently supports the calls listed [https://wiki.mozilla.org/Auto-tools/Projects/Marionette/Marionette_Client_API here].
| |
| | |
| These calls work on desktop Firefox. B2G has support for all but navigation calls (goBack, goUrl, etc.). Birch/Mobile support has yet to be added.
| |
| | |
| = Components =
| |
| | |
| == Marionette JSON Protocol ==
| |
| | |
| In the [https://wiki.mozilla.org/Remote_Debugging_Protocol JSON Remote Debugging Protocol] supported by the remote debugger, all messages are targeted at an actor. The remote debugger allows messages to be targeted at the browser, a tab, a thread, or a stack frame.
| |
| | |
| We have a Marionette root actor that registers the Marionette Driver actor. This root actor is spoken to by the client when it first connects, and then can get any other actors from the actor pool, which currently only holds the Driver actor. Any additional actors will be added to the root actor's actor pool.
| |
| | |
| The Marionette Driver actor listens for messages that are mapped to the [http://code.google.com/p/selenium/wiki/JsonWireProtocol#/ Selenium JSON Wire Protocol]. In order to preserve compatibility with Selenium, we do not change the structure or meaning of existing pieces of this protocol, but are free to [http://code.google.com/p/selenium/wiki/DefiningNewWireProtocolCommands add new messages] to it.
| |
| | |
| The Driver actor operates in chrome space, so all commands directed at chrome context gets executed here. Content commands get processed by a content listener that gets loaded by the Driver via [https://developer.mozilla.org/en/The_message_manager messageManager]'s loadFrameScript. The Driver sends messages via messageManager to the content listener. The listener then does the command in content space, and returns a message to the Driver, who then communicates the response to the client.
| |
| | |
| == Marionette Actor and the Remote Debugger ==
| |
| | |
| The remote debugger's root actor and the Marionette root actor listen on separate ports, so they will not interfere with one another.
| |
| | |
| = Code =
| |
| | |
| Marionette is landed in m-c under testing/marionette. It currently is enabled in B2G builds, but not others.
| |
| | |
| To enable it in Firefox, apply this patch:
| |
| | |
| diff -r ec68c96fb9dc browser/app/profile/firefox.js
| |
| --- a/browser/app/profile/firefox.js Fri Apr 13 13:06:01 2012 -0700
| |
| +++ b/browser/app/profile/firefox.js Tue Apr 17 16:01:42 2012 -0700
| |
| @@ -1139,3 +1139,8 @@
| |
| // number of startup crashes that can occur before starting into safe mode automatically
| |
| // (this pref has no effect if more than 6 hours have passed since the last crash)
| |
| pref("toolkit.startup.max_resumed_crashes", 2);
| |
| +
| |
| +// Marionette
| |
| +pref("marionette.defaultPrefs.enabled", true);
| |
| +pref("marionette.defaultPrefs.port", 2828);
| |
| +
| |
| diff -r ec68c96fb9dc browser/confvars.sh
| |
| --- a/browser/confvars.sh Fri Apr 13 13:06:01 2012 -0700
| |
| +++ b/browser/confvars.sh Tue Apr 17 16:01:42 2012 -0700
| |
| @@ -73,3 +73,4 @@
| |
| MOZ_PROFILE_MIGRATOR=1
| |
| MOZ_EXTENSION_MANAGER=1
| |
| MOZ_APP_STATIC_INI=1
| |
| +ENABLE_MARIONETTE=1
| |
| diff -r ec68c96fb9dc browser/installer/package-manifest.in
| |
| --- a/browser/installer/package-manifest.in Fri Apr 13 13:06:01 2012 -0700
| |
| +++ b/browser/installer/package-manifest.in Tue Apr 17 16:01:42 2012 -0700
| |
| @@ -616,3 +616,10 @@
| |
| @BINPATH@/*.xqs
| |
| @BINPATH@/components/*.xqs
| |
| #endif
| |
| +
| |
| +; [Marionette]
| |
| +@BINPATH@/chrome/marionette@JAREXT@
| |
| +@BINPATH@/chrome/marionette.manifest
| |
| +@BINPATH@/components/MarionetteComponents.manifest
| |
| +@BINPATH@/components/marionettecomponent.js
| |
| +
| |
| | |
| = How to Enable Marionette without building from Scratch =
| |
| If you do now want to build Firefox but would like to use Marionette you can do the following steps to get it working. You will have to have at least Firefox 15 installed to make this work. You will need to have a copy of Mozilla Central local or just get the files from http://hg.mozilla.org/mozilla-central/testing/marionette. I will reference that as $MARIONETTE
| |
| | |
| * navigate to the directory where the Firefox binary is. I will reference by $INSTALL e.g /Applications/Firefox/Contents/MacOS/ or /usr/local/lib/firefox/ or c:\Program Files\Firefox
| |
| * copy all of the .JS files from $MARIONETTE to $INSTALL/marionette/chrome/content
| |
| * copy $MARIONETTE/atoms.js to $INSTALL/chrome/marionette/content
| |
| * copy $MARIONETTE/components to $INSTALL/components
| |
| * Update $INSTALL/chrome.manifest by adding
| |
| manifest chrome/marionette.manifest
| |
| manifest components/MarionetteComponents.manifest
| |
| * create file $INSTALL/chrome/marionette.manifest and add
| |
| content marionette marionette/content/
| |