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

Side by Side Diff: tests/standalone/io/http_body_test.dart

Issue 13996024: Add the HttpBodyHandler files to the dart:io library (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/io.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:io'; 5 import 'dart:io';
6 import 'dart:utf'; 6 import 'dart:utf';
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 void testHttpClientResponseBody() { 10 void testHttpClientResponseBody() {
11 new HttpBodyHandler();
12 void test(String mimeType, 11 void test(String mimeType,
13 List<int> content, 12 List<int> content,
14 dynamic expectedBody, 13 dynamic expectedBody,
15 String type, 14 String type,
16 [bool shouldFail = false]) { 15 [bool shouldFail = false]) {
17 HttpServer.bind().then((server) { 16 HttpServer.bind().then((server) {
18 server.listen((request) { 17 server.listen((request) {
19 request.listen( 18 request.listen(
20 (_) {}, 19 (_) {},
21 onDone: () { 20 onDone: () {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 "json"); 157 "json");
159 test("application/json", 158 test("application/json",
160 '{ bad json }'.codeUnits, 159 '{ bad json }'.codeUnits,
161 null, 160 null,
162 "json", 161 "json",
163 true); 162 true);
164 163
165 test(null, "body".codeUnits, "body".codeUnits, "binary"); 164 test(null, "body".codeUnits, "body".codeUnits, "binary");
166 } 165 }
167 166
168
169 void main() { 167 void main() {
170 testHttpClientResponseBody(); 168 testHttpClientResponseBody();
171 testHttpServerRequestBody(); 169 testHttpServerRequestBody();
172 } 170 }
OLDNEW
« no previous file with comments | « sdk/lib/io/io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698