B2G/gecko/testing/marionette/marionette-server.js
/**
   * Navigates to given url
   *
   * @param object aRequest
   *        'value' member holds the url to navigate to
   */
Navigates to given url
@param object aRequest
'value' member holds the url to navigate to
Navigates to given url @param object aRequest ' value ' member holds the url to navigate to
function MDA_goUrl(aRequest) {
    let command_id = this.command_id = this.getCommandId();
    if (this.context != "chrome") {
      aRequest.command_id = command_id;
      aRequest.pageTimeout = this.pageTimeout;
      this.sendAsync("goUrl", aRequest, command_id);
      return;
    }
    this.getCurrentWindow().location.href = aRequest.value;
    let checkTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
    let start = new Date().getTime();
    let end = null;
    function checkLoad() { 
      end = new Date().getTime();
      let elapse = end - start;
      if (this.pageTimeout == null || elapse <= this.pageTimeout){
        if (curWindow.document.readyState == "complete") { 
          sendOk(command_id);
          return;
        }
        else{ 
          checkTimer.initWithCallback(checkLoad, 100, Ci.nsITimer.TYPE_ONE_SHOT);
        }
      }
      else{
        sendError("Error loading page", 13, null, command_id);
        return;
      }
    }
    checkTimer.initWithCallback(checkLoad, 100, Ci.nsITimer.TYPE_ONE_SHOT);
  }
function MDA_goUrl ( aRequest ) { let command_id = this . command_id = this . getCommandId ( ) ; if ( this . context != "chrome" ) { aRequest . command_id = command_id ; aRequest . pageTimeout = this . pageTimeout ; this . sendAsync ( "goUrl" , aRequest , command_id ) ; return ; } this . getCurrentWindow ( ) . location . href = aRequest . value ; let checkTimer = Cc [ "@mozilla.org/timer;1" ] . createInstance ( Ci . nsITimer ) ; let start = new Date ( ) . getTime ( ) ; let end = null ; function checkLoad ( ) { end = new Date ( ) . getTime ( ) ; let elapse = end - start ; if ( this . pageTimeout == null || elapse <= this . pageTimeout ) { if ( curWindow . document . readyState == "complete" ) { sendOk ( command_id ) ; return ; } else { checkTimer . initWithCallback ( checkLoad , 100 , Ci . nsITimer . TYPE_ONE_SHOT ) ; } } else { sendError ( "Error loading page" , 13 , null , command_id ) ; return ; } } checkTimer . initWithCallback ( checkLoad , 100 , Ci . nsITimer . TYPE_ONE_SHOT ) ; }
Navigates to given url
 @param object aRequest
        'value' member holds the url to navigate to
Navigates to given url @param object aRequest ' value ' member holds the url to navigate to
//end