B2G/gecko/testing/marionette/marionette-server.js
/**
 * The server connection is responsible for all marionette API calls. It gets created
 * for each connection and manages all chrome and browser based calls. It
 * mediates content calls by issuing appropriate messages to the content process.
 */
The server connection is responsible for all marionette API calls. It gets created
for each connection and manages all chrome and browser based calls. It
mediates content calls by issuing appropriate messages to the content process.
The server connection is responsible for all marionette API calls . It gets created for each connection and manages all chrome and browser based calls . It mediates content calls by issuing appropriate messages to the content process .
function MarionetteServerConnection(aPrefix, aTransport, aServer)
{
  this.uuidGen = Cc["@mozilla.org/uuid-generator;1"]
                   .getService(Ci.nsIUUIDGenerator);
  this.prefix = aPrefix;
  this.server = aServer;
  this.conn = aTransport;
  this.conn.hooks = this;
  this.actorID = "0";
  this.globalMessageManager = Cc["@mozilla.org/globalmessagemanager;1"]
                             .getService(Ci.nsIMessageBroadcaster);
  this.messageManager = this.globalMessageManager;
  this.browsers = {}; 
  this.curBrowser = null; 
  this.context = "content";
  this.scriptTimeout = null;
  this.searchTimeout = null;
  this.pageTimeout = null;
  this.timer = null;
  this.marionetteLog = new MarionetteLogObj();
  this.command_id = null;
  this.mainFrame = null; 
  this.curFrame = null; 
  this.importedScripts = FileUtils.getFile('TmpD', ['marionettescriptchrome']);
  this.currentRemoteFrame = null; 
  this.currentFrameElement = null;
  this.testName = null;
  this.mozBrowserClose = null;
  this.addMessageManagerListeners(this.messageManager);
}
function MarionetteServerConnection ( aPrefix , aTransport , aServer ) { this . uuidGen = Cc [ "@mozilla.org/uuid-generator;1" ] . getService ( Ci . nsIUUIDGenerator ) ; this . prefix = aPrefix ; this . server = aServer ; this . conn = aTransport ; this . conn . hooks = this ; this . actorID = "0" ; this . globalMessageManager = Cc [ "@mozilla.org/globalmessagemanager;1" ] . getService ( Ci . nsIMessageBroadcaster ) ; this . messageManager = this . globalMessageManager ; this . browsers = { } ; this . curBrowser = null ; this . context = "content" ; this . scriptTimeout = null ; this . searchTimeout = null ; this . pageTimeout = null ; this . timer = null ; this . marionetteLog = new MarionetteLogObj ( ) ; this . command_id = null ; this . mainFrame = null ; this . curFrame = null ; this . importedScripts = FileUtils . getFile ( 'TmpD' , [ 'marionettescriptchrome' ] ) ; this . currentRemoteFrame = null ; this . currentFrameElement = null ; this . testName = null ; this . mozBrowserClose = null ; this . addMessageManagerListeners ( this . messageManager ) ; }
The server connection is responsible for all marionette API calls.
The server connection is responsible for all marionette API calls .
// marionette uses a protocol based on the debugger server, which requires // passing back "actor ids" with responses. unlike the debugger server, // we don't have multiple actors, so just use a dummy value of "0" here //holds list of BrowserObjs // points to current browser //topmost chrome frame //subframe that currently has focus // a member of remoteFrames //register all message listeners