| Index: runtime/observatory/tests/service/echo_test.dart
|
| diff --git a/runtime/observatory/tests/service/echo_test.dart b/runtime/observatory/tests/service/echo_test.dart
|
| index d86b1f2c377d139b8c22e0f8b12019067e8ac3a4..64399dec9cd112c252bd550954ecae99c8d80c12 100644
|
| --- a/runtime/observatory/tests/service/echo_test.dart
|
| +++ b/runtime/observatory/tests/service/echo_test.dart
|
| @@ -9,33 +9,37 @@ import 'package:unittest/unittest.dart';
|
| import 'test_helper.dart';
|
|
|
| var tests = [
|
| - (Isolate isolate) =>
|
| - isolate.vm.invokeRpc('_echo', {'text': 'hello'}).then((result) {
|
| - expect(result['type'], equals('_EchoResponse'));
|
| - expect(result['text'], equals('hello'));
|
| - }),
|
| - (Isolate isolate) =>
|
| - isolate.invokeRpc('_echo', {'text': 'hello'}).then((result) {
|
| - expect(result['type'], equals('_EchoResponse'));
|
| - expect(result['text'], equals('hello'));
|
| - }),
|
| - (Isolate isolate) async {
|
| - Completer completer = new Completer();
|
| - var stream = await isolate.vm.getEventStream('_Echo');
|
| - var subscription;
|
| - subscription = stream.listen((ServiceEvent event) {
|
| - assert(event.kind == '_Echo');
|
| - expect(event.data.lengthInBytes, equals(3));
|
| - expect(event.data.getUint8(0), equals(0));
|
| - expect(event.data.getUint8(1), equals(128));
|
| - expect(event.data.getUint8(2), equals(255));
|
| - subscription.cancel();
|
| - completer.complete();
|
| - });
|
| -
|
| - await isolate.invokeRpc('_triggerEchoEvent', {'text': 'hello'});
|
| - await completer.future;
|
| - },
|
| +
|
| +(Isolate isolate) =>
|
| + isolate.vm.invokeRpc('_echo', { 'text': 'hello'}).then((result) {
|
| + expect(result['type'], equals('_EchoResponse'));
|
| + expect(result['text'], equals('hello'));
|
| + }),
|
| +
|
| +(Isolate isolate) =>
|
| + isolate.invokeRpc('_echo', { 'text': 'hello'}).then((result) {
|
| + expect(result['type'], equals('_EchoResponse'));
|
| + expect(result['text'], equals('hello'));
|
| + }),
|
| +
|
| +(Isolate isolate) async {
|
| + Completer completer = new Completer();
|
| + var stream = await isolate.vm.getEventStream('_Echo');
|
| + var subscription;
|
| + subscription = stream.listen((ServiceEvent event) {
|
| + assert(event.kind == '_Echo');
|
| + expect(event.data.lengthInBytes, equals(3));
|
| + expect(event.data.getUint8(0), equals(0));
|
| + expect(event.data.getUint8(1), equals(128));
|
| + expect(event.data.getUint8(2), equals(255));
|
| + subscription.cancel();
|
| + completer.complete();
|
| + });
|
| +
|
| + await isolate.invokeRpc('_triggerEchoEvent', { 'text': 'hello' });
|
| + await completer.future;
|
| +},
|
| +
|
| ];
|
|
|
| main(args) => runIsolateTests(args, tests);
|
|
|