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

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

Issue 65043019: Use a re-usable buffer for writing HTTP headers. This includes a new header limit of 8192 bytes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleanup. Created 7 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_impl.dart ('k') | tests/standalone/io/http_server_response_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_client_request_test.dart
diff --git a/tests/standalone/io/http_client_request_test.dart b/tests/standalone/io/http_client_request_test.dart
index fb6dcd69f8d4db7022ed922d18d83e9e4f440907..9015b9f4abf46eb58162ff88e6fad13952bcb6ea 100644
--- a/tests/standalone/io/http_client_request_test.dart
+++ b/tests/standalone/io/http_client_request_test.dart
@@ -9,6 +9,7 @@ import "dart:typed_data";
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
+
void testClientRequest(Future handler(request)) {
HttpServer.bind("127.0.0.1", 0).then((server) {
server.listen((request) {
@@ -31,6 +32,7 @@ void testClientRequest(Future handler(request)) {
});
}
+
void testResponseDone() {
testClientRequest((request) {
request.close().then((res1) {
@@ -42,6 +44,7 @@ void testResponseDone() {
});
}
+
void testBadResponseAdd() {
asyncStart();
testClientRequest((request) {
@@ -80,6 +83,7 @@ void testBadResponseAdd() {
});
}
+
void testBadResponseClose() {
asyncStart();
testClientRequest((request) {
@@ -103,8 +107,26 @@ void testBadResponseClose() {
});
}
+
+void testBadHeaders() {
+ asyncStart();
+ testClientRequest((request) {
+ var value = "a";
+ for (int i = 0; i < 8 * 1024; i++) {
+ value += 'a';
+ }
+ request.headers.set('name', value);
+ request.done.catchError((error) {
+ asyncEnd();
+ }, test: (e) => e is HttpException);
+ return request.close();
+ });
+}
+
+
void main() {
testResponseDone();
testBadResponseAdd();
testBadResponseClose();
+ testBadHeaders();
}
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_server_response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698