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

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

Issue 11410003: Refactoring of the HTTP library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 8 years, 1 month 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_parser.dart ('k') | tests/standalone/io/http_parser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_connection_close_test.dart
diff --git a/tests/standalone/io/http_connection_close_test.dart b/tests/standalone/io/http_connection_close_test.dart
index b3e8bd71e6ec0bfd112b2dfb4c971fa74152c2da..ac6cedd4be516f96bf7d6fb0210f6ebc682694b5 100644
--- a/tests/standalone/io/http_connection_close_test.dart
+++ b/tests/standalone/io/http_connection_close_test.dart
@@ -6,7 +6,7 @@
#import("dart:isolate");
#import("dart:io");
-void testHttp10Close() {
+void testHttp10Close(bool closeRequest) {
HttpServer server = new HttpServer();
server.listen("127.0.0.1", 0, backlog: 5);
@@ -14,15 +14,16 @@ void testHttp10Close() {
socket.onConnect = () {
List<int> buffer = new List<int>(1024);
socket.outputStream.writeString("GET / HTTP/1.0\r\n\r\n");
+ if (closeRequest) socket.outputStream.close();
socket.onData = () => socket.readList(buffer, 0, buffer.length);
socket.onClosed = () {
- socket.close(true);
+ if (!closeRequest) socket.close(true);
server.close();
};
};
}
-void testHttp11Close() {
+void testHttp11Close(bool closeRequest) {
HttpServer server = new HttpServer();
server.listen("127.0.0.1", 0, backlog: 5);
@@ -31,15 +32,18 @@ void testHttp11Close() {
List<int> buffer = new List<int>(1024);
socket.outputStream.writeString(
"GET / HTTP/1.1\r\nConnection: close\r\n\r\n");
+ if (closeRequest) socket.outputStream.close();
socket.onData = () => socket.readList(buffer, 0, buffer.length);
socket.onClosed = () {
- socket.close(true);
+ if (!closeRequest) socket.close(true);
server.close();
};
};
}
main() {
- testHttp10Close();
- testHttp11Close();
+ testHttp10Close(false);
+ testHttp10Close(true);
+ testHttp11Close(false);
+ testHttp11Close(true);
}
« no previous file with comments | « sdk/lib/io/http_parser.dart ('k') | tests/standalone/io/http_parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698