| Index: tests/isolate/unresolved_ports_test.dart
|
| diff --git a/tests/isolate/unresolved_ports_test.dart b/tests/isolate/unresolved_ports_test.dart
|
| index 2ffa633f410ecbd10984358bbeefe4cb1b5803c0..b6ca58dc8f397b3738a94722fb553403c76f7129 100644
|
| --- a/tests/isolate/unresolved_ports_test.dart
|
| +++ b/tests/isolate/unresolved_ports_test.dart
|
| @@ -4,6 +4,7 @@
|
|
|
| // spawns multiple isolates and sends unresolved ports between them.
|
| library unresolved_ports;
|
| +
|
| import 'dart:async';
|
| import 'dart:isolate';
|
| import 'package:unittest/unittest.dart';
|
| @@ -20,23 +21,24 @@ bethIsolate(init) {
|
| ReceivePort port = initIsolate(init);
|
| // TODO(sigmund): use expectAsync when it is OK to use it within an isolate
|
| // (issue #6856)
|
| - port.first.then((msg) => msg[1].send([
|
| - '${msg[0]}\nBeth says: Tim are you coming? And Bob?', msg[2]]));
|
| + port.first.then((msg) => msg[1]
|
| + .send(['${msg[0]}\nBeth says: Tim are you coming? And Bob?', msg[2]]));
|
| }
|
|
|
| timIsolate(init) {
|
| ReceivePort port = initIsolate(init);
|
| spawnFunction(bobIsolate).then((bob) {
|
| port.first.then((msg) => bob.send([
|
| - '${msg[0]}\nTim says: Can you tell "main" that we are all coming?',
|
| - msg[1]]));
|
| + '${msg[0]}\nTim says: Can you tell "main" that we are all coming?',
|
| + msg[1]
|
| + ]));
|
| });
|
| }
|
|
|
| bobIsolate(init) {
|
| ReceivePort port = initIsolate(init);
|
| - port.first.then((msg) => msg[1].send(
|
| - '${msg[0]}\nBob says: we are all coming!'));
|
| + port.first
|
| + .then((msg) => msg[1].send('${msg[0]}\nBob says: we are all coming!'));
|
| }
|
|
|
| Future<SendPort> spawnFunction(function) {
|
| @@ -55,21 +57,25 @@ baseTest({bool failForNegativeTest: false}) {
|
| test('Message chain with unresolved ports', () {
|
| ReceivePort port = new ReceivePort();
|
| port.listen(expectAsync((msg) {
|
| - expect(msg, equals('main says: Beth, find out if Tim is coming.'
|
| - '\nBeth says: Tim are you coming? And Bob?'
|
| - '\nTim says: Can you tell "main" that we are all coming?'
|
| - '\nBob says: we are all coming!'));
|
| + expect(
|
| + msg,
|
| + equals('main says: Beth, find out if Tim is coming.'
|
| + '\nBeth says: Tim are you coming? And Bob?'
|
| + '\nTim says: Can you tell "main" that we are all coming?'
|
| + '\nBob says: we are all coming!'));
|
| expect(failForNegativeTest, isFalse);
|
| port.close();
|
| }));
|
|
|
| spawnFunction(timIsolate).then((tim) {
|
| spawnFunction(bethIsolate).then((beth) {
|
| - beth.send(['main says: Beth, find out if Tim is coming.',
|
| - tim, port.sendPort]);
|
| + beth.send([
|
| + 'main says: Beth, find out if Tim is coming.',
|
| + tim,
|
| + port.sendPort
|
| + ]);
|
| });
|
| });
|
| -
|
| });
|
| }
|
|
|
|
|