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

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

Issue 15842004: Support auto-drain of HttpRequest data. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add documentation. Created 7 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 | « tests/standalone/io/http_parser_test.dart ('k') | tests/standalone/io/http_session_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_server_response_test.dart
diff --git a/tests/standalone/io/http_server_response_test.dart b/tests/standalone/io/http_server_response_test.dart
index 0e75d349842007f1218de3408d11126bc08508c0..5b0a5259c8e1b04fee67a8d0abce148901aaa00a 100644
--- a/tests/standalone/io/http_server_response_test.dart
+++ b/tests/standalone/io/http_server_response_test.dart
@@ -243,6 +243,34 @@ void testBadResponseClose() {
}
+void testIgnoreRequestData() {
+ HttpServer.bind("127.0.0.1", 0)
+ .then((server) {
+ server.listen((request) {
+ // Ignore request data.
+ request.response.write("all-okay");
+ request.response.close();
+ });
+
+ var client = new HttpClient();
+ client.get("127.0.0.1", server.port, "/")
+ .then((request) {
+ request.contentLength = 1024 * 1024;
+ request.add(new Uint8List(1024 * 1024));
+ return request.close();
+ })
+ .then((response) {
+ response
+ .fold(0, (s, b) => s + b.length)
+ .then((bytes) {
+ Expect.equals(8, bytes);
+ server.close();
+ });
+ });
+ });
+}
+
+
void main() {
testResponseDone();
testResponseAddStream();
@@ -250,4 +278,5 @@ void main() {
testResponseAddClosed();
testBadResponseAdd();
testBadResponseClose();
+ testIgnoreRequestData();
}
« no previous file with comments | « tests/standalone/io/http_parser_test.dart ('k') | tests/standalone/io/http_session_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698