Index: tests/standalone/io/http_parser_test.dart |
diff --git a/tests/standalone/io/http_parser_test.dart b/tests/standalone/io/http_parser_test.dart |
index 858e5ad2af6f8c659d1a111c71372abcab417619..1145ec7af4fd584c50a26b8ae9ad86bb39cc8243 100644 |
--- a/tests/standalone/io/http_parser_test.dart |
+++ b/tests/standalone/io/http_parser_test.dart |
@@ -86,8 +86,8 @@ class HttpParserTest { |
int remaining = requestData.length - pos; |
int writeLength = min(chunkSize, remaining); |
written += writeLength; |
- int parsed = httpParser.writeList(requestData, pos, writeLength); |
- unparsed = writeLength - parsed; |
+ httpParser.writeList(requestData, pos, writeLength); |
+ unparsed = httpParser.readUnparsedData().length; |
if (httpParser.upgrade) { |
unparsed += requestData.length - written; |
break; |
@@ -133,7 +133,9 @@ class HttpParserTest { |
void testWrite(List<int> requestData, [int chunkSize = -1]) { |
if (chunkSize == -1) chunkSize = requestData.length; |
reset(); |
- for (int pos = 0; pos < requestData.length; pos += chunkSize) { |
+ for (int pos = 0; |
+ pos < requestData.length && !errorCalled; |
+ pos += chunkSize) { |
int remaining = requestData.length - pos; |
int writeLength = min(chunkSize, remaining); |
httpParser.writeList(requestData, pos, writeLength); |
@@ -230,8 +232,8 @@ class HttpParserTest { |
int remaining = requestData.length - pos; |
int writeLength = min(chunkSize, remaining); |
written += writeLength; |
- int parsed = httpParser.writeList(requestData, pos, writeLength); |
- unparsed = writeLength - parsed; |
+ httpParser.writeList(requestData, pos, writeLength); |
+ unparsed = httpParser.readUnparsedData().length; |
if (httpParser.upgrade) { |
unparsed += requestData.length - written; |
break; |
@@ -280,7 +282,9 @@ class HttpParserTest { |
void testWrite(List<int> requestData, [int chunkSize = -1]) { |
if (chunkSize == -1) chunkSize = requestData.length; |
reset(); |
- for (int pos = 0; pos < requestData.length; pos += chunkSize) { |
+ for (int pos = 0; |
+ pos < requestData.length && !errorCalled; |
+ pos += chunkSize) { |
int remaining = requestData.length - pos; |
int writeLength = min(chunkSize, remaining); |
httpParser.writeList(requestData, pos, writeLength); |