| Index: tests/standalone/io/http_content_length_test.dart
|
| diff --git a/tests/standalone/io/http_content_length_test.dart b/tests/standalone/io/http_content_length_test.dart
|
| index 917b014c1de1c632c82e5af6eedd38c345f6af35..47ef94166916fcfcc8ce7d344f40c9c0db054aab 100644
|
| --- a/tests/standalone/io/http_content_length_test.dart
|
| +++ b/tests/standalone/io/http_content_length_test.dart
|
| @@ -38,10 +38,13 @@ void testNoBody(int totalConnections, bool explicitContentLength) {
|
| Expect.equals("0", response.headers.value('content-length'));
|
| Expect.equals(0, response.contentLength);
|
| count++;
|
| - if (count == totalConnections) {
|
| - client.shutdown();
|
| - server.close();
|
| - }
|
| + response.inputStream.onData = response.inputStream.read;
|
| + response.inputStream.onClosed = () {
|
| + if (count == totalConnections) {
|
| + client.shutdown();
|
| + server.close();
|
| + }
|
| + };
|
| };
|
| }
|
| }
|
| @@ -82,10 +85,13 @@ void testBody(int totalConnections) {
|
| Expect.equals("2", response.headers.value('content-length'));
|
| Expect.equals(2, response.contentLength);
|
| count++;
|
| - if (count == totalConnections) {
|
| - client.shutdown();
|
| - server.close();
|
| - }
|
| + response.inputStream.onData = response.inputStream.read;
|
| + response.inputStream.onClosed = () {
|
| + if (count == totalConnections) {
|
| + client.shutdown();
|
| + server.close();
|
| + }
|
| + };
|
| };
|
| }
|
| }
|
|
|