B2G/gaia/tests/performance/performance_helper.js
/* opts can have the following keys:
   * - spawnInterval (optional): defines how many seconds we must wait before
   *   launching an app. Default is 6000.
   * - runs (optional): defines how many runs we should do. Default is 5.
   */
opts can have the following keys:
- spawnInterval (optional): defines how many seconds we must wait before
launching an app. Default is 6000.
- runs (optional): defines how many runs we should do. Default is 5.
opts can have the following keys : - spawnInterval ( optional ) : defines how many seconds we must wait before launching an app . Default is 6000 . - runs ( optional ) : defines how many runs we should do . Default is 5 .
function PerformanceHelper(opts) {
    this.opts = {
      spawnInterval: 6000,
      runs: window.mozTestInfo.runs
    };
    extend(this.opts, opts);
    if (! this.opts.app) {
      var errMsg = 'The "app" property must be configured.';
      throw new Error('PerformanceHelper: ' + errMsg);
    }
    this.app = this.opts.app;
    this.runs = this.opts.runs;
    this.results = Object.create(null);
  }
function PerformanceHelper ( opts ) { this . opts = { spawnInterval : 6000 , runs : window . mozTestInfo . runs } ; extend ( this . opts , opts ) ; if ( ! this . opts . app ) { var errMsg = 'The "app" property must be configured.' ; throw new Error ( 'PerformanceHelper: ' + errMsg ) ; } this . app = this . opts . app ; this . runs = this . opts . runs ; this . results = Object . create ( null ) ; }
opts can have the following keys:
 - spawnInterval (optional): defines how many seconds we must wait before
   launching an app.
opts can have the following keys : - spawnInterval ( optional ) : defines how many seconds we must wait before launching an app .
// default values // Time before gecko spawns a new template process // see the pref dom.ipc.processPrelaunch.delayMs in // http://mxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js#577 // FIXME it would be very nice to get it automatically via marionette // we add 1s to this value to give a little more time to the background // task to finish the preloading // overwrite values from the user