Chromium Code Reviews| Index: tests/standalone/io/http_body_test.dart |
| diff --git a/tests/standalone/io/http_body_test.dart b/tests/standalone/io/http_body_test.dart |
| index c25406e0f643111ee6a681341000b179e94fbf88..ae0d128242965fb8f3ce586a499f35d9b680b3d0 100644 |
| --- a/tests/standalone/io/http_body_test.dart |
| +++ b/tests/standalone/io/http_body_test.dart |
| @@ -98,13 +98,20 @@ void testHttpServerRequestBody() { |
| Expect.equals(type, body.type); |
| switch (type) { |
| case "text": |
| + Expect.equals(body.mimeType, "text/plain"); |
|
Søren Gjesse
2013/04/15 11:11:28
Should we add body.contentType to return the full
Anders Johnsen
2013/04/15 11:19:26
Well, the charset is not interesting anymore (it's
|
| Expect.equals(expectedBody, body.body); |
| break; |
| case "json": |
| + Expect.equals(body.mimeType, "application/json"); |
| Expect.mapEquals(expectedBody, body.body); |
| break; |
| + case "binary": |
| + Expect.equals(body.mimeType, null); |
| + Expect.listEquals(expectedBody, body.body); |
| + break; |
| + |
| default: |
| Expect.fail("bad body type"); |
| } |
| @@ -116,8 +123,10 @@ void testHttpServerRequestBody() { |
| var client = new HttpClient(); |
| client.post("127.0.0.1", server.port, "/") |
| .then((request) { |
| - request.headers.contentType = |
| - new ContentType.fromString(mimeType); |
| + if (mimeType != null) { |
| + request.headers.contentType = |
| + new ContentType.fromString(mimeType); |
| + } |
| request.add(content); |
| return request.close(); |
| }) |
| @@ -152,6 +161,8 @@ void testHttpServerRequestBody() { |
| null, |
| "json", |
| true); |
| + |
| + test(null, "body".codeUnits, "body".codeUnits, "binary"); |
| } |