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