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

Side by Side Diff: pkg/http/test/html/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, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/http/test/html/client_test.dart ('k') | pkg/http/test/html/utils.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library http.test.html.streamed_request_test;
6
7 import 'dart:convert';
8
9 import 'package:http/http.dart' as http;
10 import 'package:http/browser_client.dart';
11 import 'package:unittest/unittest.dart';
12
13 import 'utils.dart';
14
15 void main() {
16 group('contentLength', () {
17 test("works when it's set", () {
18 var request = new http.StreamedRequest('POST', echoUrl);
19 request.contentLength = 10;
20 request.sink.add([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
21 request.sink.close();
22
23 return new BrowserClient().send(request).then((response) {
24 expect(response.stream.toBytes(),
25 completion(equals([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])));
26 });
27 });
28
29 test("works when it's not set", () {
30 var request = new http.StreamedRequest('POST', echoUrl);
31 request.sink.add([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
32 request.sink.close();
33
34 return new BrowserClient().send(request).then((response) {
35 expect(response.stream.toBytes(),
36 completion(equals([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])));
37 });
38 });
39 });
40 }
OLDNEW
« no previous file with comments | « pkg/http/test/html/client_test.dart ('k') | pkg/http/test/html/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698