Chromium Code Reviews| Index: runtime/observatory/tests/service/service_test_common.dart |
| diff --git a/runtime/observatory/tests/service/service_test_common.dart b/runtime/observatory/tests/service/service_test_common.dart |
| index 872d994c547bdcc38032eab6ef9bdbe37ff4d638..ed77d7a61b8cde675930b5a41b68def142a1ce67 100644 |
| --- a/runtime/observatory/tests/service/service_test_common.dart |
| +++ b/runtime/observatory/tests/service/service_test_common.dart |
| @@ -11,6 +11,22 @@ import 'package:unittest/unittest.dart'; |
| typedef Future IsolateTest(Isolate isolate); |
| typedef Future VMTest(VM vm); |
| +Map<String, StreamSubscription> streamSubscriptions = {}; |
| + |
| +Future subscribedToStream(VM vm, String streamName, onEvent) async { |
|
turnidge
2016/03/03 19:18:16
how do you feel about calling this subscribeToStre
Cutch
2016/03/03 19:43:25
Done.
|
| + assert(streamSubscriptions[streamName] == null); |
| + |
| + Stream stream = await vm.getEventStream(streamName); |
| + StreamSubscription subscription = stream.listen(onEvent); |
| + streamSubscriptions[streamName] = subscription; |
| +} |
| + |
| +Future cancelStreamSubscription(String streamName) async { |
| + StreamSubscription subscription = streamSubscriptions[streamName]; |
| + subscription.cancel(); |
| + streamSubscriptions.remove(streamName); |
| +} |
| + |
| Future asyncStepOver(Isolate isolate) async { |
| final Completer pausedAtSyntheticBreakpoint = new Completer(); |
| StreamSubscription subscription; |