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

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

Issue 261763002: Rip out the last dart:io dependency from pkg/http. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review 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/http/test/request_test.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 c9e3689dc372fc6d9cb1ca76e9812c027627d04e..afe8e098fcc56cbda28b249221fc92868dbc7237 100644
--- a/pkg/http/test/streamed_request_test.dart
+++ b/pkg/http/test/streamed_request_test.dart
@@ -23,52 +23,10 @@ void main() {
expect(() => request.contentLength = -1, throwsArgumentError);
});
- test('controls the Content-Length header', () {
- return startServer().then((_) {
- var request = new http.StreamedRequest('POST', serverUrl);
- request.contentLength = 10;
- request.sink.add([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- request.sink.close();
-
- return request.send();
- }).then((response) {
- expect(UTF8.decodeStream(response.stream),
- completion(parse(containsPair('headers',
- containsPair('content-length', ['10'])))));
- }).whenComplete(stopServer);
- });
-
- test('defaults to sending no Content-Length', () {
- return startServer().then((_) {
- var request = new http.StreamedRequest('POST', serverUrl);
- request.sink.add([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
- request.sink.close();
-
- return request.send();
- }).then((response) {
- expect(UTF8.decodeStream(response.stream),
- completion(parse(containsPair('headers',
- isNot(contains('content-length'))))));
- }).whenComplete(stopServer);
- });
-
test('is frozen by finalize()', () {
var request = new http.StreamedRequest('POST', dummyUrl);
request.finalize();
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/test/request_test.dart ('k') | pkg/http/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698