B2G/gecko/dom/browser-element/mochitest/browserElementTestHelpers.js
// argument to resolve() is the childID of the subprocess.
argument to resolve() is the childID of the subprocess.
argument to resolve () is the childID of the subprocess .
function expectProcessCreated() {
  var deferred = Promise.defer();
  var observed = false;
  browserElementTestHelpers.addProcessPriorityObserver(
    "process-created",
    function(subject, topic, data) {
      if (observed) {
        return;
      }
      observed = true;
      var childID = parseInt(data);
      ok(true, 'Got new process, id=' + childID);
      deferred.resolve(childID);
    }
  );
  return deferred.promise;
}
function expectProcessCreated ( ) { var deferred = Promise . defer ( ) ; var observed = false ; browserElementTestHelpers . addProcessPriorityObserver ( "process-created" , function ( subject , topic , data ) { if ( observed ) { return ; } observed = true ; var childID = parseInt ( data ) ; ok ( true , 'Got new process, id=' + childID ) ; deferred . resolve ( childID ) ; } ) ; return deferred . promise ; }
argument to resolve() is the childID of the subprocess.
argument to resolve () is the childID of the subprocess .
// Don't run this observer twice, so we don't ok(true) twice.  (It's fine // to resolve a promise twice; the second resolve() call does nothing.)