anchor.diff:            });
   
             test('stream-big-block-parts--with-server-error-recovery', () {
  +            var numFailedAttempts = 4 * 3;
               var options = new ResumableUploadOptions(
  -                chunkSize: 256 * 1024, numberOfAttempts: 4);
  +                chunkSize: 256 * 1024, numberOfAttempts: 4,
  +                backoffFunction: backoffWrapper(numFailedAttempts));
               runTest(1, 1024 * 1024,
                       [1,
                        256*1024-1,
  
positive.code:    */
    final core.int chunkSize;
  
    ResumableUploadOptions({this.numberOfAttempts: 3,
                            this.chunkSize: 1024 * 1024}) {
      // See e.g. here:
      // https://developers.google.com/maps-engine/documentation/resumable-upload
      //
  
negative.code:         if (attemptsLeft > 0 &&
              (status == 500 || (502 <= status && status < 504))) {
            return response.read().drain().then((_) {
              // Delay the next attempt. Default backoff function is exponential.
              int failedAttemts = _options.numberOfAttempts - attemptsLeft;
              var duration = _options.backoffFunction(failedAttemts);
              if (duration == null) {
                throw new common_external.DetailedApiRequestError(
                    status,
                    'Resumable upload: Uploading a chunk resulted in status '
                    '$status. Maximum number of retries reached.');
              }
  
              return new Future.delayed(duration).then((_) {
                return tryUpload(attemptsLeft - 1);
              });
            });
          } else if (!lastChunk && status != 308) {
              return response.read().drain().then((_) {
                throw new common_external.DetailedApiRequestError(
                    status,
                    'Resumable upload: Uploading a chunk resulted in status '
                    '$status instead of 308.');
              });
          } else if (lastChunk && status != 201 && status != 200) {
            return response.read().drain().then((_) {
              throw new common_external.DetailedApiRequestError(
                  status,
                  'Resumable upload: Uploading a chunk resulted in status '
                  '$status instead of 200 or 201.');
            });
          } else {
  