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

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

Issue 215533005: Fix a bug in [http.BaseRequest.send]'s content length handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/lib/src/base_request.dart ('k') | pkg/http/test/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/streamed_request_test.dart
diff --git a/pkg/http/test/streamed_request_test.dart b/pkg/http/test/streamed_request_test.dart
index 761102c8aa464ed18517cfd7fb1499425b574bb0..c9e3689dc372fc6d9cb1ca76e9812c027627d04e 100644
--- a/pkg/http/test/streamed_request_test.dart
+++ b/pkg/http/test/streamed_request_test.dart
@@ -58,4 +58,17 @@ void main() {
expect(() => request.contentLength = 10, throwsStateError);
});
});
+
+ // Regression test.
+ test('.send() with a response with no content length', () {
+ return startServer().then((_) {
+ var request = new http.StreamedRequest(
+ 'GET', serverUrl.resolve('/no-content-length'));
+ request.sink.close();
+ return request.send();
+ }).then((response) {
+ expect(UTF8.decodeStream(response.stream), completion(equals('body')));
+ }).whenComplete(stopServer);
+ });
+
}
« no previous file with comments | « pkg/http/lib/src/base_request.dart ('k') | pkg/http/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698