code: function resolveResult(win, result, resolver) {
    if (result.ok) {
      resolver(result);
    } else {
      const error = result.error || createAbortError(win);
      error.activityResult = result;
      resolver(Promise.reject(error));
    }
  }
docs: Resolves the activity result as a promise:
  - `OK` result is yielded as the promise's payload;
  - `CANCEL` result is rejected with the `AbortError`;
  - `FAILED` result is rejected with the embedded error.
  
  @param {!Window} win
  @param {!ActivityResult} result
  @param {function((!ActivityResult|!Promise))} resolver