B2G/gecko/toolkit/components/search/tests/xpcshell/head_search.js
/**
 * Creates an nsIXULAppInfo
 * @param   id
 *          The ID of the test application
 * @param   name
 *          A name for the test application
 * @param   version
 *          The version of the application
 * @param   platformVersion
 *          The gecko version of the application
 */
Creates an nsIXULAppInfo
@param   id
The ID of the test application
@param   name
A name for the test application
@param   version
The version of the application
@param   platformVersion
The gecko version of the application
Creates an nsIXULAppInfo @param id The ID of the test application @param name A name for the test application @param version The version of the application @param platformVersion The gecko version of the application
function createAppInfo(id, name, version, platformVersion)
{
  gXULAppInfo = {
    vendor: "Mozilla",
    name: name,
    ID: id,
    version: version,
    appBuildID: "2007010101",
    platformVersion: platformVersion,
    platformBuildID: "2007010101",
    inSafeMode: false,
    logConsoleErrors: true,
    OS: "XPCShell",
    XPCOMABI: "noarch-spidermonkey",
    invalidateCachesOnRestart: function invalidateCachesOnRestart() {},
    QueryInterface: function QueryInterface(iid) {
      if (iid.equals(Components.interfaces.nsIXULAppInfo)
       || iid.equals(Components.interfaces.nsIXULRuntime)
       || iid.equals(Components.interfaces.nsISupports))
        return this;
      throw Components.results.NS_ERROR_NO_INTERFACE;
    }
  };
  var XULAppInfoFactory = {
    createInstance: function (outer, iid) {
      if (outer != null)
        throw Components.results.NS_ERROR_NO_AGGREGATION;
      return gXULAppInfo.QueryInterface(iid);
    }
  };
  var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
  registrar.registerFactory(XULAPPINFO_CID, "XULAppInfo",
                            XULAPPINFO_CONTRACTID, XULAppInfoFactory);
}
function createAppInfo ( id , name , version , platformVersion ) { gXULAppInfo = { vendor : "Mozilla" , name : name , ID : id , version : version , appBuildID : "2007010101" , platformVersion : platformVersion , platformBuildID : "2007010101" , inSafeMode : false , logConsoleErrors : true , OS : "XPCShell" , XPCOMABI : "noarch-spidermonkey" , invalidateCachesOnRestart : function invalidateCachesOnRestart ( ) { } , QueryInterface : function QueryInterface ( iid ) { if ( iid . equals ( Components . interfaces . nsIXULAppInfo ) || iid . equals ( Components . interfaces . nsIXULRuntime ) || iid . equals ( Components . interfaces . nsISupports ) ) return this ; throw Components . results . NS_ERROR_NO_INTERFACE ; } } ; var XULAppInfoFactory = { createInstance : function ( outer , iid ) { if ( outer != null ) throw Components . results . NS_ERROR_NO_AGGREGATION ; return gXULAppInfo . QueryInterface ( iid ) ; } } ; var registrar = Components . manager . QueryInterface ( Components . interfaces . nsIComponentRegistrar ) ; registrar . registerFactory ( XULAPPINFO_CID , "XULAppInfo" , XULAPPINFO_CONTRACTID , XULAppInfoFactory ) ; }
Creates an nsIXULAppInfo
 @param   id
          The ID of the test application
 @param   name
          A name for the test application
 @param   version
          The version of the application
 @param   platformVersion
          The gecko version of the application
Creates an nsIXULAppInfo @param id The ID of the test application @param name A name for the test application @param version The version of the application @param platformVersion The gecko version of the application