Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Unified Diff: tests/standalone/io/http_10_test.dart

Issue 12655003: Buffer the entire http header to one packet, and buffer other data in chunks of 4-16 kb. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}

Powered by Google App Engine
This is Rietveld 408576698