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

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

Issue 23450003: Add encoding tests to pkg/http. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/http/test/request_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/response_test.dart
diff --git a/pkg/http/test/response_test.dart b/pkg/http/test/response_test.dart
index 531ac024389513724fed06725584bc12d16ca83f..bc1f33d6dc1e8c562b76eb93384982afacff0a6b 100644
--- a/pkg/http/test/response_test.dart
+++ b/pkg/http/test/response_test.dart
@@ -22,8 +22,12 @@ void main() {
[72, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100, 33]));
});
- // TODO(nweiz): test that this respects the inferred encoding when issue
- // 6284 is fixed.
+ test('respects the inferred encoding', () {
+ var response = new http.Response("föøbãr", 200,
+ headers: {'content-type': 'text/plain; charset=iso-8859-1'});
+ expect(response.bodyBytes, equals(
+ [102, 246, 248, 98, 227, 114]));
+ });
});
group('.bytes()', () {
@@ -37,8 +41,11 @@ void main() {
expect(response.bodyBytes, equals([104, 101, 108, 108, 111]));
});
- // TODO(nweiz): test that this respects the inferred encoding when issue
- // 6284 is fixed.
+ test('respects the inferred encoding', () {
+ var response = new http.Response.bytes([102, 246, 248, 98, 227, 114], 200,
+ headers: {'content-type': 'text/plain; charset=iso-8859-1'});
+ expect(response.body, equals("föøbãr"));
+ });
});
group('.fromStream()', () {
« no previous file with comments | « pkg/http/test/request_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698