Chromium Code Reviews| Index: test/mime_multipart_transformer_test.dart |
| diff --git a/test/mime_multipart_transformer_test.dart b/test/mime_multipart_transformer_test.dart |
| index de1dc6dec559b004de97e5b16b8e6122932ce5fe..59ed3846bd40c18a8d761a7aafd81bfd1afe77af 100644 |
| --- a/test/mime_multipart_transformer_test.dart |
| +++ b/test/mime_multipart_transformer_test.dart |
| @@ -25,13 +25,13 @@ enum TestMode { IMMEDIATE_LISTEN, DELAY_LISTEN, PAUSE_RESUME } |
| void _runParseTest(String message, String boundary, TestMode mode, |
| [List<Map> expectedHeaders, List expectedParts, bool expectError = false]) { |
| Future testWrite(List<int> data, [int chunkSize = -1]) { |
| - StreamController controller = new StreamController(sync: true); |
| + StreamController<List<int>> controller = new StreamController(sync: true); |
|
kevmoo
2016/12/09 02:30:26
make the left side var and add a generic to the ri
keertip
2016/12/09 02:39:14
Done.
|
| var stream = |
| controller.stream.transform(new MimeMultipartTransformer(boundary)); |
| int i = 0; |
| var completer = new Completer(); |
| - var futures = []; |
| + var futures = <Future>[]; |
| stream.listen((multipart) { |
| int part = i++; |
| if (expectedHeaders != null) { |
| @@ -81,7 +81,7 @@ void _runParseTest(String message, String boundary, TestMode mode, |
| if (expectedParts != null) { |
| expect(i, equals(expectedParts.length)); |
| } |
| - Future.wait(futures).then(completer.complete); |
| + Future.wait(futures).then((_) => completer.complete); |
| }); |
| _writeInChunks(data, chunkSize, controller); |
| @@ -91,7 +91,7 @@ void _runParseTest(String message, String boundary, TestMode mode, |
| Future testFirstPartOnly(List<int> data, [int chunkSize = -1]) { |
| var completer = new Completer(); |
| - var controller = new StreamController(sync: true); |
| + StreamController<List<int>> controller = new StreamController(sync: true); |
|
kevmoo
2016/12/09 02:30:26
ditto
keertip
2016/12/09 02:39:14
Done.
|
| var stream = |
| controller.stream.transform(new MimeMultipartTransformer(boundary)); |
| @@ -117,12 +117,12 @@ void _runParseTest(String message, String boundary, TestMode mode, |
| Future testCompletePartAfterCancel(List<int> data, int parts, |
| [int chunkSize = -1]) { |
| var completer = new Completer(); |
| - var controller = new StreamController(sync: true); |
| + StreamController<List<int>> controller = new StreamController(sync: true); |
|
kevmoo
2016/12/09 02:30:26
ditto
keertip
2016/12/09 02:39:14
Done.
|
| var stream = |
| controller.stream.transform(new MimeMultipartTransformer(boundary)); |
| var subscription; |
| int i = 0; |
| - var futures = []; |
| + var futures = <Future>[]; |
| subscription = stream.listen((multipart) { |
| int partIndex = i; |
| @@ -141,7 +141,7 @@ void _runParseTest(String message, String boundary, TestMode mode, |
| if (partIndex == (parts - 1)) { |
| subscription.cancel(); |
| - Future.wait(futures).then(completer.complete); |
| + Future.wait(futures).then((_) => completer.complete); |
|
kevmoo
2016/12/09 02:30:26
If you put a generic type on the completer does th
keertip
2016/12/09 02:39:14
That doesn't work. The original error is ERROR: Th
kevmoo
2016/12/09 02:53:32
So typing the completer as `var completer = new Co
|
| } |
| i++; |
| }); |