Index: tests/standalone/io/http_headers_test.dart |
diff --git a/tests/standalone/io/http_headers_test.dart b/tests/standalone/io/http_headers_test.dart |
index 1c84cd51fefe4eda662b03d3c78e0e0349c83484..26edb5fe1855770eeab7bd9ed6239d2170293e4d 100644 |
--- a/tests/standalone/io/http_headers_test.dart |
+++ b/tests/standalone/io/http_headers_test.dart |
@@ -380,6 +380,11 @@ void testContentType() { |
" text/html ; charset = utf-8 ; xxx=yyy "); |
check(contentType, "text", "html", {"charset": "utf-8", "xxx": "yyy"}); |
+ contentType = ContentType.parse("text/html; charset=;"); |
+ check(contentType, "text", "html", {"charset": null}); |
+ contentType = ContentType.parse("text/html; charset;"); |
+ check(contentType, "text", "html", {"charset": null}); |
+ |
// Test builtin content types. |
check(ContentType.TEXT, "text", "plain", {"charset": "utf-8"}); |
check(ContentType.HTML, "text", "html", {"charset": "utf-8"}); |
@@ -387,6 +392,20 @@ void testContentType() { |
check(ContentType.BINARY, "application", "octet-stream"); |
} |
+void testKnownContentTypes() { |
+ // Well known content types used by the VM service. |
+ ContentType.parse('text/html; charset=UTF-8'); |
+ ContentType.parse('application/dart; charset=UTF-8'); |
+ ContentType.parse('application/javascript; charset=UTF-8'); |
+ ContentType.parse('text/css; charset=UTF-8'); |
+ ContentType.parse('image/gif'); |
+ ContentType.parse('image/png'); |
+ ContentType.parse('image/jpeg'); |
+ ContentType.parse('image/jpeg'); |
+ ContentType.parse('image/svg+xml'); |
+ ContentType.parse('text/plain'); |
+} |
+ |
void testContentTypeCache() { |
_HttpHeaders headers = new _HttpHeaders("1.1"); |
headers.set(HttpHeaders.CONTENT_TYPE, "text/html"); |
@@ -570,6 +589,7 @@ main() { |
testEnumeration(); |
testHeaderValue(); |
testContentType(); |
+ testKnownContentTypes(); |
testContentTypeCache(); |
testCookie(); |
testInvalidCookie(); |