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

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
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_client_request_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bf88a9ac99970c3dde698a127ada06b330d677af 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");
+ socket.write("GET / HTTP/1.0\r\n");
socket.write("Connection: Keep-Alive\r\n\r\n");
List<int> response = [];
@@ -90,7 +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"));
@@ -206,8 +206,7 @@ void testHttp10KeepAliveServerCloses() {
void main() {
testHttp10NoKeepAlive();
- // TODO(8871): This test fails with short socket writes.
- //testHttp10ServerClose();
+ testHttp10ServerClose();
testHttp10KeepAlive();
testHttp10KeepAliveServerCloses();
}
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_client_request_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698