then(onFulfilled = null, onRejected = null) {
    if (onFulfilled != null && typeof onFulfilled != 'function') {
      throw Error('onFulfilled should be a function.');
    }
    if (onRejected != null && typeof onRejected != 'function') {
      throw Error('onRejected should be a function.');
    }

    return this.addChildPromise_(onFulfilled, onRejected);
  }
/**
   * Adds callbacks that will operate on the result of the Promise, returning a
   * new child Promise.
   *
   * If the Promise is fulfilled, the `onFulfilled` callback will be
   * invoked with the fulfillment value as argument, and the child Promise will
   * be fulfilled with the return value of the callback. If the callback throws
   * an exception, the child Promise will be rejected with the thrown value
   * instead.
   *
   * If the Promise is rejected, the `onRejected` callback will be invoked
   * with the rejection reason as argument, and the child Promise will be
   * resolved with the return value or rejected with the thrown value of the
   * callback.
   *
   * @param {?(function(TYPE):?)=} onFulfilled A
   *     function that will be invoked with the fulfillment value if the Promise
   *     is fulfilled.
   * @param {?(function(*): *)=} onRejected A function that will
   *     be invoked with the rejection reason if the Promise is rejected.
   * @return {!mr.MockPromise} A new Promise that will receive the result of the
   *     callback.
   * @override
   */
Adds callbacks that will operate on the result of the Promise, returning a
new child Promise.

If the Promise is fulfilled, the `onFulfilled` callback will be
invoked with the fulfillment value as argument, and the child Promise will
be fulfilled with the return value of the callback. If the callback throws
an exception, the child Promise will be rejected with the thrown value
instead.

If the Promise is rejected, the `onRejected` callback will be invoked
with the rejection reason as argument, and the child Promise will be
resolved with the return value or rejected with the thrown value of the
callback.

@param {?(function(TYPE):?)=} onFulfilled A
function that will be invoked with the fulfillment value if the Promise
is fulfilled.
@param {?(function(*): *)=} onRejected A function that will
be invoked with the rejection reason if the Promise is rejected.
@return {!mr.MockPromise} A new Promise that will receive the result of the
callback.
@override
Adds callbacks that will operate on the result of the Promise returning a new child Promise . If the Promise is fulfilled the ` onFulfilled ` callback will be invoked with the fulfillment value as argument and the child Promise will be fulfilled with the return value of the callback . If the callback throws an exception the child Promise will be rejected with the thrown value instead . If the Promise is rejected the ` onRejected ` callback will be invoked with the rejection reason as argument and the child Promise will be resolved with the return value or rejected with the thrown value of the callback . @param { ? ( function ( TYPE ) : ? ) = } onFulfilled A function that will be invoked with the fulfillment value if the Promise is fulfilled . @param { ? ( function ( * ) : * ) = } onRejected A function that will be invoked with the rejection reason if the Promise is rejected . @return { !mr . MockPromise } A new Promise that will receive the result of the callback . @override
then(onFulfilled = null, onRejected = null) {
    if (onFulfilled != null && typeof onFulfilled != 'function') {
      throw Error('onFulfilled should be a function.');
    }
    if (onRejected != null && typeof onRejected != 'function') {
      throw Error('onRejected should be a function.');
    }
    return this.addChildPromise_(onFulfilled, onRejected);
  }
then ( onFulfilled = null , onRejected = null ) { if ( onFulfilled != null && typeof onFulfilled != 'function' ) { throw Error ( 'onFulfilled should be a function.' ) ; } if ( onRejected != null && typeof onRejected != 'function' ) { throw Error ( 'onRejected should be a function.' ) ; } return this . addChildPromise_ ( onFulfilled , onRejected ) ; }
Adds callbacks that will operate on the result of the Promise, returning a
 new child Promise.
Adds callbacks that will operate on the result of the Promise returning a new child Promise .