Index: tests/standalone/io/http_client_connect_test.dart |
diff --git a/tests/standalone/io/http_client_connect_test.dart b/tests/standalone/io/http_client_connect_test.dart |
index b6b8e37c4c38b7b56c3344582e90a2dd930d7750..70f224247917e2e920dbd5da6b321354af3a0cf7 100644 |
--- a/tests/standalone/io/http_client_connect_test.dart |
+++ b/tests/standalone/io/http_client_connect_test.dart |
@@ -151,6 +151,7 @@ void testGetDataServerForceClose() { |
void testPostEmptyRequest() { |
HttpServer.bind("127.0.0.1", 0).then((server) { |
server.listen((request) { |
+ Expect.equals('POST', request.method); |
request.pipe(request.response); |
}); |
@@ -164,6 +165,40 @@ void testPostEmptyRequest() { |
} |
+void testPutEmptyRequest() { |
+ HttpServer.bind("127.0.0.1", 0).then((server) { |
+ server.listen((request) { |
+ Expect.equals('PUT', request.method); |
+ request.pipe(request.response); |
+ }); |
+ |
+ var client = new HttpClient(); |
+ client.put("127.0.0.1", server.port, "/") |
+ .then((request) => request.close()) |
+ .then((response) { |
+ response.listen((data) {}, onDone: server.close); |
+ }); |
+ }); |
+} |
+ |
+ |
+void testDeleteEmptyRequest() { |
+ HttpServer.bind("127.0.0.1", 0).then((server) { |
+ server.listen((request) { |
+ Expect.equals('DELETE', request.method); |
+ request.pipe(request.response); |
+ }); |
+ |
+ var client = new HttpClient(); |
+ client.delete("127.0.0.1", server.port, "/") |
+ .then((request) => request.close()) |
+ .then((response) { |
+ response.listen((data) {}, onDone: server.close); |
+ }); |
+ }); |
+} |
Lasse Reichstein Nielsen
2014/04/22 08:49:47
Test putUrl and deleteUrl?
Anders Johnsen
2014/04/22 10:58:36
Done.
|
+ |
+ |
void testNoBuffer() { |
asyncStart(); |
HttpServer.bind("127.0.0.1", 0).then((server) { |
@@ -219,5 +254,7 @@ void main() { |
testGetServerForceClose(); |
testGetDataServerForceClose(); |
testPostEmptyRequest(); |
+ testPutEmptyRequest(); |
+ testDeleteEmptyRequest(); |
testNoBuffer(); |
} |