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

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

Issue 246923003: Add HttpClient:put/delete/head/patch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
« sdk/lib/io/http_impl.dart ('K') | « sdk/lib/io/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_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();
}
« sdk/lib/io/http_impl.dart ('K') | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698