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

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

Issue 2486213002: Test showing crash when stepping through new Map creation. (Closed)
Patch Set: Refactored test to use more helper routines. Created 4 years, 1 month 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
« no previous file with comments | « runtime/observatory/tests/service/service.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/tests/service/step_test.dart
diff --git a/runtime/observatory/tests/service/step_test.dart b/runtime/observatory/tests/service/step_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..47009dc490aba26ec85107030121a4faa2f76809
--- /dev/null
+++ b/runtime/observatory/tests/service/step_test.dart
@@ -0,0 +1,38 @@
+import 'dart:async';
+import 'test_helper.dart';
+import 'service_test_common.dart';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+const int LINE_A = 10;
+
+code() {
+ var x = {}; // LINE_A
+}
+
+Future<Isolate> stepThroughProgram(Isolate isolate) async {
+ Completer completer = new Completer();
+ int pauseEventsSeen = 0;
+
+ await subscribeToStream(isolate.vm, VM.kDebugStream,
+ (ServiceEvent event) async {
+ if (event.kind == ServiceEvent.kPauseBreakpoint) {
+ // We are paused: Step further.
+ pauseEventsSeen++;
+ isolate.stepInto();
+ } else if (event.kind == ServiceEvent.kPauseExit) {
+ // We are at the exit: The test is done.
+ expect(pauseEventsSeen > 20, true,
+ reason: "Saw only $pauseEventsSeen pause events.");
+ await cancelStreamSubscription(VM.kDebugStream);
+ completer.complete();
+ }
+ });
+ isolate.resume();
+ return completer.future;
+}
+
+var tests = [hasPausedAtStart, setBreakpointAtLine(LINE_A), stepThroughProgram];
+
+main(args) => runIsolateTestsSynchronous(args, tests,
+ testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
« no previous file with comments | « runtime/observatory/tests/service/service.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698