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

Unified Diff: pkg/shelf/test/response_test.dart

Issue 227563010: pkg/shelf: case-insensitive headers, cleaner Request ctor, a lot more tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixing dependent code, changelog 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
« no previous file with comments | « pkg/shelf/test/request_test.dart ('k') | pkg/shelf/test/shelf_io_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/test/response_test.dart
diff --git a/pkg/shelf/test/response_test.dart b/pkg/shelf/test/response_test.dart
index 3006d703adc41a1cf87c7972054c5d09a0db4092..9ee47c5f93360f8a62b82680a7bdd597ff12be3e 100644
--- a/pkg/shelf/test/response_test.dart
+++ b/pkg/shelf/test/response_test.dart
@@ -34,26 +34,6 @@ void main() {
..close();
});
});
-
- test("defaults to UTF-8", () {
- var response = new Response.ok(
- new Stream.fromIterable([[195, 168]]));
- expect(response.readAsString(), completion(equals("è")));
- });
-
- test("the content-type header overrides the default", () {
- var response = new Response.ok(
- new Stream.fromIterable([[195, 168]]),
- headers: {'content-type': 'text/plain; charset=iso-8859-1'});
- expect(response.readAsString(), completion(equals("è")));
- });
-
- test("an explicit encoding overrides the content-type header", () {
- var response = new Response.ok(
- new Stream.fromIterable([[195, 168]]),
- headers: {'content-type': 'text/plain; charset=utf-8'});
- expect(response.readAsString(LATIN1), completion(equals("è")));
- });
});
group("read", () {
@@ -154,48 +134,6 @@ void main() {
});
});
- group("mimeType", () {
- test("is null without a content-type header", () {
- expect(new Response.ok("okay!").mimeType, isNull);
- });
-
- test("comes from the content-type header", () {
- expect(new Response.ok("okay!", headers: {
- 'content-type': 'text/plain'
- }).mimeType, equals('text/plain'));
- });
-
- test("doesn't include parameters", () {
- expect(new Response.ok("okay!", headers: {
- 'content-type': 'text/plain; foo=bar; bar=baz'
- }).mimeType, equals('text/plain'));
- });
- });
-
- group("encoding", () {
- test("is null without a content-type header", () {
- expect(new Response.ok("okay!").encoding, isNull);
- });
-
- test("is null without a charset parameter", () {
- expect(new Response.ok("okay!", headers: {
- 'content-type': 'text/plain'
- }).encoding, isNull);
- });
-
- test("is null with an unrecognized charset parameter", () {
- expect(new Response.ok("okay!", headers: {
- 'content-type': 'text/plain; charset=fblthp'
- }).encoding, isNull);
- });
-
- test("comes from the content-type charset parameter", () {
- expect(new Response.ok("okay!", headers: {
- 'content-type': 'text/plain; charset=iso-8859-1'
- }).encoding, equals(LATIN1));
- });
- });
-
group("expires", () {
test("is null without an Expires header", () {
expect(new Response.ok("okay!").expires, isNull);
@@ -219,16 +157,4 @@ void main() {
}).lastModified, equals(DateTime.parse("1994-11-06 08:49:37z")));
});
});
-
- group("contentLength", () {
- test("is null without a content-length header", () {
- expect(new Response.ok("okay!").contentLength, isNull);
- });
-
- test("comes from the content-length header", () {
- expect(new Response.ok("okay!", headers: {
- 'content-length': '42'
- }).contentLength, equals(42));
- });
- });
}
« no previous file with comments | « pkg/shelf/test/request_test.dart ('k') | pkg/shelf/test/shelf_io_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698