Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: runtime/observatory/tests/service/service_test_common.dart

Issue 2366463002: Fix stepping over await statements (Closed)
Patch Set: Merge branch 'master' into deb Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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');
}
};
}
« no previous file with comments | « runtime/observatory/tests/service/issue_27238_test.dart ('k') | runtime/observatory/tests/service/step_over_await_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698