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

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

Issue 10386040: Avoid using chunked transfer encoding when the HTTP verision is 1.0. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | « runtime/bin/http_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cf2614588f647c6def0d187187f3c253d8ca7087..978fa3f783460a8b884b46859c6e88fd54695dc2 100644
--- a/tests/standalone/io/http_content_length_test.dart
+++ b/tests/standalone/io/http_content_length_test.dart
@@ -79,7 +79,32 @@ void testBody(int totalConnections) {
}
}
+void testHttp10() {
+ HttpServer server = new HttpServer();
+ server.onError = (e) => Expect.fail("Unexpected error $e");
+ server.listen("127.0.0.1", 0, 5);
+ server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
+ OutputStream stream = response.outputStream;
+ Expect.equals("1.0", request.protocolVersion);
+ Expect.throws(() => stream.writeString("x"), (e) => e is HttpException);
+ response.contentLength = 0;
+ stream.close();
+ };
+
+ Socket socket = new Socket("127.0.0.1", server.port);
+ socket.onConnect = () {
+ List<int> buffer = new List<int>(1024);
+ socket.outputStream.writeString("GET / HTTP/1.0\r\n\r\n");
+ socket.onData = () => socket.readList(buffer, 0, buffer.length);
+ socket.onClosed = () {
Mads Ager (google) 2012/05/09 07:42:14 Indentation is off.
Søren Gjesse 2012/05/09 08:57:02 Done.
+ socket.close(true);
+ server.close();
+ };
+ };
+}
+
void main() {
testNoBody(5);
testBody(5);
+ testHttp10();
}
« no previous file with comments | « runtime/bin/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698