Chromium Code Reviews| Index: tests/standalone/io/http_10_test.dart |
| diff --git a/tests/standalone/io/http_10_test.dart b/tests/standalone/io/http_10_test.dart |
| index 705086ccb144a0ca42d14a847aa87e25f7e68c1b..099588f3893882fdd21244cc8b6017f46ba73155 100644 |
| --- a/tests/standalone/io/http_10_test.dart |
| +++ b/tests/standalone/io/http_10_test.dart |
| @@ -45,7 +45,6 @@ void testHttp10NoKeepAlive() { |
| count++; |
| socket.destroy(); |
| String s = new String.fromCharCodes(response).toLowerCase(); |
| - Expect.equals("z", s[s.length - 1]); |
| Expect.isTrue(s.indexOf("\r\ncontent-length: 1\r\n") > 0); |
| Expect.equals(-1, s.indexOf("keep-alive")); |
| if (count < 10) { |
| @@ -70,17 +69,19 @@ void testHttp10ServerClose() { |
| (HttpRequest request) { |
| Expect.isNull(request.headers.value('content-length')); |
| Expect.equals(-1, request.contentLength); |
| - var response = request.response; |
| - Expect.equals("1.0", request.protocolVersion); |
| - response.write("Z"); |
| - response.close(); |
| + request.listen((_) {}, onDone: () { |
| + var response = request.response; |
| + Expect.equals("1.0", request.protocolVersion); |
| + response.write("Z"); |
| + response.close(); |
| + }); |
| }, |
| onError: (e) => Expect.fail("Unexpected error $e")); |
| int count = 0; |
| makeRequest() { |
| Socket.connect("127.0.0.1", server.port).then((socket) { |
| - socket.write("GET / HTTP/1.0\r\n\r\n"); |
|
Søren Gjesse
2013/03/12 11:30:55
Oops
Anders Johnsen
2013/03/12 12:11:30
Hehe yeah, funny typo :)
|
| + socket.write("GET / HTTP/1.0\r\n"); |
| socket.write("Connection: Keep-Alive\r\n\r\n"); |
| List<int> response = []; |
| @@ -90,8 +91,6 @@ void testHttp10ServerClose() { |
| socket.destroy(); |
| count++; |
| String s = new String.fromCharCodes(response).toLowerCase(); |
| - print(s); |
| - Expect.equals("z", s[s.length - 1]); |
| Expect.equals(-1, s.indexOf("content-length:")); |
| Expect.equals(-1, s.indexOf("keep-alive")); |
|
Søren Gjesse
2013/03/12 11:30:55
Shouldn't we still check for 'z' as the last chara
Anders Johnsen
2013/03/12 12:11:30
Ahh, you are right. Adding back.
|
| if (count < 10) { |
| @@ -206,8 +205,7 @@ void testHttp10KeepAliveServerCloses() { |
| void main() { |
| testHttp10NoKeepAlive(); |
| - // TODO(8871): This test fails with short socket writes. |
| - //testHttp10ServerClose(); |
| + testHttp10ServerClose(); |
| testHttp10KeepAlive(); |
| testHttp10KeepAliveServerCloses(); |
| } |