OLD | NEW |
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:async'; |
| 6 import 'dart:math'; |
| 7 |
5 import "package:unittest/unittest.dart"; | 8 import "package:unittest/unittest.dart"; |
6 import "package:mime/mime.dart"; | 9 import "package:mime/mime.dart"; |
7 import 'dart:async'; | |
8 import 'dart:math'; | |
9 | 10 |
10 void testParse(String message, | 11 void testParse(String message, |
11 String boundary, | 12 String boundary, |
12 [List<Map> expectedHeaders, | 13 [List<Map> expectedHeaders, |
13 List expectedParts, | 14 List expectedParts, |
14 bool expectError = false]) { | 15 bool expectError = false]) { |
15 Future testWrite(List<int> data, [int chunkSize = -1]) { | 16 Future testWrite(List<int> data, [int chunkSize = -1]) { |
16 StreamController controller = new StreamController(sync: true); | 17 StreamController controller = new StreamController(sync: true); |
17 | 18 |
18 var stream = controller.stream.transform( | 19 var stream = controller.stream.transform( |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 \r | 314 \r |
314 Body2\r | 315 Body2\r |
315 --xxx\r\n"""; | 316 --xxx\r\n"""; |
316 testParse(message, "xxx", null, [null, null], true); | 317 testParse(message, "xxx", null, [null, null], true); |
317 } | 318 } |
318 | 319 |
319 void main() { | 320 void main() { |
320 testParseValid(); | 321 testParseValid(); |
321 testParseInvalid(); | 322 testParseInvalid(); |
322 } | 323 } |
OLD | NEW |