| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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:math'); | 5 import 'dart:math'; |
| 6 | 6 |
| 7 #source("../../../lib/io/http_parser.dart"); | 7 part "../../../sdk/lib/io/http_parser.dart"; |
| 8 #source("../../../lib/io/mime_multipart_parser.dart"); | 8 part "../../../sdk/lib/io/mime_multipart_parser.dart"; |
| 9 | 9 |
| 10 void testParse(String message, | 10 void testParse(String message, |
| 11 String boundary, | 11 String boundary, |
| 12 [List<Map> expectedHeaders, | 12 [List<Map> expectedHeaders, |
| 13 List expectedParts]) { | 13 List expectedParts]) { |
| 14 _MimeMultipartParser parser; | 14 _MimeMultipartParser parser; |
| 15 int partCount; | 15 int partCount; |
| 16 Map headers; | 16 Map headers; |
| 17 List<int> currentPart; | 17 List<int> currentPart; |
| 18 bool lastPartCalled; | 18 bool lastPartCalled; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 \r | 331 \r |
| 332 Body2\r | 332 Body2\r |
| 333 --xxx\r\n"""; | 333 --xxx\r\n"""; |
| 334 Expect.throws(() => testParse(message, "xxx", null, [null, null])); | 334 Expect.throws(() => testParse(message, "xxx", null, [null, null])); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void main() { | 337 void main() { |
| 338 testParseValid(); | 338 testParseValid(); |
| 339 testParseInvalid(); | 339 testParseInvalid(); |
| 340 } | 340 } |
| OLD | NEW |