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 4b3dc366a5ebb750341969dc1794d659b2b6a34c..9cf11cdba44ebb9d4709beb83e4cab3e43944e66 100644 |
--- a/runtime/observatory/tests/service/service_test_common.dart |
+++ b/runtime/observatory/tests/service/service_test_common.dart |
@@ -28,6 +28,43 @@ Future cancelStreamSubscription(String streamName) async { |
streamSubscriptions.remove(streamName); |
} |
+Future smartNext(Isolate isolate) async { |
+ print('smartNext'); |
+ if (isolate.status == M.IsolateStatus.paused) { |
+ var event = isolate.pauseEvent; |
+ if (event.atAsyncSuspension) { |
+ return asyncNext(isolate); |
+ } else { |
+ return syncNext(isolate); |
+ } |
+ } else { |
+ throw 'The program is already running'; |
+ } |
+} |
+ |
+Future asyncNext(Isolate isolate) async { |
+ print('asyncNext'); |
+ if (isolate.status == M.IsolateStatus.paused) { |
+ var event = isolate.pauseEvent; |
+ if (!event.atAsyncSuspension) { |
+ throw 'No async continuation at this location'; |
+ } else { |
+ return isolate.stepOverAsyncSuspension(); |
+ } |
+ } else { |
+ throw 'The program is already running'; |
+ } |
+} |
+ |
+Future syncNext(Isolate isolate) async { |
+ print('syncNext'); |
+ if (isolate.status == M.IsolateStatus.paused) { |
+ return isolate.stepOver(); |
+ } else { |
+ throw 'The program is already running'; |
+ } |
+} |
+ |
Future asyncStepOver(Isolate isolate) async { |
final Completer pausedAtSyntheticBreakpoint = new Completer(); |
StreamSubscription subscription; |
@@ -198,6 +235,8 @@ IsolateTest stoppedAtLine(int line) { |
sb.write(" $f [${await f.location.getLine()}]\n"); |
} |
throw sb.toString(); |
+ } else { |
+ print('Program is stopped at line: $line'); |
} |
}; |
} |