function testPromiseAndApps(promise, apps) {
  promise.then(function() {
    return Promise.all(
        apps.map(function(app) {
          return new Promise(checkIfNoErrorsOccuredOnApp.bind(null, app));
        }));
  }).then(chrome.test.callbackPass(function() {
    // The callbackPass is necessary to avoid prematurely finishing tests.
    // Don't use chrome.test.succeed() here to avoid doubled success log.
  }), function(error) {
    chrome.test.fail(error.stack || error);
  });
}
/**
 * Adds check of chrome.test to the end of the given promise.
 * @param {Promise} promise Promise to add the check to.
 * @param {Array<!RemoteCall>} apps An array of RemoteCall interfaces.
 */
Adds check of chrome.test to the end of the given promise.
@param {Promise} promise Promise to add the check to.
@param {Array} apps An array of RemoteCall interfaces.
Adds check of chrome . test to the end of the given promise . @param { Promise } promise Promise to add the check to . @param { Array } apps An array of RemoteCall interfaces .
function testPromiseAndApps(promise, apps) {
  promise.then(function() {
    return Promise.all(
        apps.map(function(app) {
          return new Promise(checkIfNoErrorsOccuredOnApp.bind(null, app));
        }));
  }).then(chrome.test.callbackPass(function() {
  }), function(error) {
    chrome.test.fail(error.stack || error);
  });
}
function testPromiseAndApps ( promise , apps ) { promise . then ( function ( ) { return Promise . all ( apps . map ( function ( app ) { return new Promise ( checkIfNoErrorsOccuredOnApp . bind ( null , app ) ) ; } ) ) ; } ) . then ( chrome . test . callbackPass ( function ( ) { } ) , function ( error ) { chrome . test . fail ( error . stack || error ) ; } ) ; }
Adds check of chrome.test to the end of the given promise.
Adds check of chrome . test to the end of the given promise .
// The callbackPass is necessary to avoid prematurely finishing tests. // Don't use chrome.test.succeed() here to avoid doubled success log.