B2G/gecko/testing/marionette/marionette-server.js
/**
   * Create a new BrowserObj for window and add to known browsers
   * 
   * @param nsIDOMWindow win
   *        Window for which we will create a BrowserObj
   *
   * @return string
   *        Returns the unique server-assigned ID of the window
   */
Create a new BrowserObj for window and add to known browsers

@param nsIDOMWindow win
Window for which we will create a BrowserObj

@return string
Returns the unique server-assigned ID of the window
Create a new BrowserObj for window and add to known browsers @param nsIDOMWindow win Window for which we will create a BrowserObj @return string Returns the unique server - assigned ID of the window
function MDA_addBrowser(win) {
    let browser = new BrowserObj(win);
    let winId = win.QueryInterface(Ci.nsIInterfaceRequestor).
                    getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
    winId = winId + ((appName == "B2G") ? '-b2g' : '');
    this.browsers[winId] = browser;
    this.curBrowser = this.browsers[winId];
    if (this.curBrowser.elementManager.seenItems[winId] == undefined) {
      this.curBrowser.elementManager.seenItems[winId] = Cu.getWeakReference(win);
    }
  }
function MDA_addBrowser ( win ) { let browser = new BrowserObj ( win ) ; let winId = win . QueryInterface ( Ci . nsIInterfaceRequestor ) . getInterface ( Ci . nsIDOMWindowUtils ) . outerWindowID ; winId = winId + ( ( appName == "B2G" ) ? '-b2g' : '' ) ; this . browsers [ winId ] = browser ; this . curBrowser = this . browsers [ winId ] ; if ( this . curBrowser . elementManager . seenItems [ winId ] == undefined ) { this . curBrowser . elementManager . seenItems [ winId ] = Cu . getWeakReference ( win ) ; } }
Create a new BrowserObj for window and add to known browsers
Create a new BrowserObj for window and add to known browsers
//add this to seenItems so we can guarantee the user will get winId as this window's id