Index: runtime/observatory/tests/service/pause_on_start_and_exit_test.dart |
diff --git a/runtime/observatory/tests/service/pause_on_start_and_exit_test.dart b/runtime/observatory/tests/service/pause_on_start_and_exit_test.dart |
index 0ccd29df0861effbc41346ef29c9b8ce8381bda5..b292b31d8111f8c1827935af75cedf5f5f71ab50 100644 |
--- a/runtime/observatory/tests/service/pause_on_start_and_exit_test.dart |
+++ b/runtime/observatory/tests/service/pause_on_start_and_exit_test.dart |
@@ -14,74 +14,78 @@ void testMain() { |
} |
var tests = [ |
- (Isolate isolate) async { |
- print('Getting stream...'); |
- Completer completer = new Completer(); |
- var stream = await isolate.vm.getEventStream(VM.kDebugStream); |
- print('Subscribing...'); |
- var subscription; |
- subscription = stream.listen((ServiceEvent event) { |
- if (event.kind == ServiceEvent.kPauseStart) { |
- print('Received $event'); |
- subscription.cancel(); |
- completer.complete(); |
- } else { |
- print('Ignoring event $event'); |
- } |
- }); |
- print('Subscribed. Pause event is ${isolate.pauseEvent}'); |
- if (isolate.pauseEvent != null && isolate.pauseEvent is M.PauseStartEvent) { |
- // Wait for the isolate to hit PauseStart. |
+(Isolate isolate) async { |
+ print('Getting stream...'); |
+ Completer completer = new Completer(); |
+ var stream = await isolate.vm.getEventStream(VM.kDebugStream); |
+ print('Subscribing...'); |
+ var subscription; |
+ subscription = stream.listen((ServiceEvent event) { |
+ if (event.kind == ServiceEvent.kPauseStart) { |
+ print('Received $event'); |
subscription.cancel(); |
- print('Subscription cancelled.'); |
+ completer.complete(); |
} else { |
- print('Waiting for pause start event.'); |
- await completer.future; |
+ print('Ignoring event $event'); |
} |
- print('Done waiting for pause event.'); |
+ }); |
+ print('Subscribed. Pause event is ${isolate.pauseEvent}'); |
- // Grab the timestamp. |
- var pausetime1 = isolate.pauseEvent.timestamp; |
- expect(pausetime1, isNotNull); |
- // Reload the isolate. |
- await isolate.reload(); |
- // Verify that it is the same. |
- expect(pausetime1.millisecondsSinceEpoch, |
- equals(isolate.pauseEvent.timestamp.millisecondsSinceEpoch)); |
+ if (isolate.pauseEvent != null && |
+ isolate.pauseEvent is M.PauseStartEvent) { |
+ // Wait for the isolate to hit PauseStart. |
+ subscription.cancel(); |
+ print('Subscription cancelled.'); |
+ } else { |
+ print('Waiting for pause start event.'); |
+ await completer.future; |
+ } |
+ print('Done waiting for pause event.'); |
+ |
+ // Grab the timestamp. |
+ var pausetime1 = isolate.pauseEvent.timestamp; |
+ expect(pausetime1, isNotNull); |
+ // Reload the isolate. |
+ await isolate.reload(); |
+ // Verify that it is the same. |
+ expect(pausetime1.millisecondsSinceEpoch, |
+ equals(isolate.pauseEvent.timestamp.millisecondsSinceEpoch)); |
+ |
+ completer = new Completer(); |
+ stream = await isolate.vm.getEventStream(VM.kDebugStream); |
+ subscription = stream.listen((ServiceEvent event) { |
+ if (event.kind == ServiceEvent.kPauseExit) { |
+ print('Received PauseExit'); |
+ subscription.cancel(); |
+ completer.complete(); |
+ } |
+ }); |
- completer = new Completer(); |
- stream = await isolate.vm.getEventStream(VM.kDebugStream); |
- subscription = stream.listen((ServiceEvent event) { |
- if (event.kind == ServiceEvent.kPauseExit) { |
- print('Received PauseExit'); |
- subscription.cancel(); |
- completer.complete(); |
- } |
- }); |
+ print('Resuming...'); |
+ isolate.resume(); |
- print('Resuming...'); |
- isolate.resume(); |
+ // Wait for the isolate to hit PauseExit. |
+ await completer.future; |
- // Wait for the isolate to hit PauseExit. |
- await completer.future; |
+ // Grab the timestamp. |
+ var pausetime2 = isolate.pauseEvent.timestamp; |
+ expect(pausetime2, isNotNull); |
+ // Reload the isolate. |
+ await isolate.reload(); |
+ // Verify that it is the same. |
+ expect(pausetime2.millisecondsSinceEpoch, |
+ equals(isolate.pauseEvent.timestamp.millisecondsSinceEpoch)); |
+ expect(pausetime2.millisecondsSinceEpoch, |
+ greaterThan(pausetime1.millisecondsSinceEpoch)); |
+}, |
- // Grab the timestamp. |
- var pausetime2 = isolate.pauseEvent.timestamp; |
- expect(pausetime2, isNotNull); |
- // Reload the isolate. |
- await isolate.reload(); |
- // Verify that it is the same. |
- expect(pausetime2.millisecondsSinceEpoch, |
- equals(isolate.pauseEvent.timestamp.millisecondsSinceEpoch)); |
- expect(pausetime2.millisecondsSinceEpoch, |
- greaterThan(pausetime1.millisecondsSinceEpoch)); |
- }, |
]; |
main(args) => runIsolateTests(args, tests, |
- testeeConcurrent: testMain, |
- pause_on_start: true, |
- pause_on_exit: true, |
- verbose_vm: true, |
- extraArgs: ['--trace-service', '--trace-service-verbose']); |
+ testeeConcurrent: testMain, |
+ pause_on_start: true, |
+ pause_on_exit: true, |
+ verbose_vm: true, |
+ extraArgs: [ '--trace-service', |
+ '--trace-service-verbose' ]); |