anchor.diff:                       256*1024+1,
                        1024*1024-1,
                        1024*1024], true);
  +          });
  +
  +          test('stream-big-block-parts--with-server-error-recovery', () {
  +            var options = new ResumableUploadOptions(
  +                chunkSize: 256 * 1024, numberOfAttempts: 4);
  +            runTest(1, 1024 * 1024,
  +                    [1,
  +                     256*1024-1,
  +                     256*1024,
  +                     256*1024+1,
  +                     1024*1024-1,
  +                     1024*1024],
  +                     true,
  +                     numberOfServerErrors: 3,
  +                     resumableOptions: options);
  +          });
  +
  +          test('stream-big-block-parts--server-error', () {
  +            var options = new ResumableUploadOptions(
  +                chunkSize: 256 * 1024, numberOfAttempts: 3);
  +            runTest(1, 1024 * 1024,
  +                    [1,
  +                     256*1024-1,
  +                     256*1024,
  +                     256*1024+1,
  +                     1024*1024-1,
  +                     1024*1024],
  +                     true,
  +                     numberOfServerErrors: 3,
  +                     resumableOptions: options,
  +                     expectedErrorStatus: 503,
  +                     messagesNrOfFailure: 4);
             });
           });
         });
  
positive.code:                            contentType: 'foobar');
          }
          validateServerRequest(e, http_base.Request request, List<int> data) {
            var h = e['headers'];
            var r = e['response'];
  
            expect(request.url.toString(), equals(e['url']));
            expect(request.method, equals(e['method']));
            h.forEach((k, v) {
              expect(request.headers[k], equals(v));
            });
  
            expect(data, equals(e['data']));
            return r;
          }
          serverRequestValidator(List expectations) {
            int i = 0;
  
negative.code:               var firstRange =
                    'bytes=0-${end-1}';
  
                // We issue [numberOfServerErrors] 503 errors first, and then a
                // successfull response.
                for (var j = 0; j < (numberOfServerErrors + 1); j++) {
                  bool successfullResponse = j == numberOfServerErrors;
  
                  var response;
                  if (successfullResponse) {
                    var headers = new HeadersImpl(
                        isLast ? {
                          'content-type' : ['application/json; charset=utf-8'],
                        } : {
                          'range' : [firstRange],
                        });
                    response = emptyResponse(isLast ? 200 : 308, headers, '');
                  } else {
                    var headers = new HeadersImpl({});
                    response = emptyResponse(503, headers, '');
                  }
  
                  expectations.add({
                    'url' : 'http://upload.com/',
                    'method' : 'PUT',
                    'data' : sublist,
                    'headers' : {
                      'content-length' : '${sublist.length}',
                      'content-range' : firstContentRange,
                      'content-type' : 'foobar',
                    },
                    'response' : response,
                  });
                }
              }
              return expectations;
            }
  