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

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

Issue 2486213002: Test showing crash when stepping through new Map creation. (Closed)
Patch Set: Marked test as failing in debug mode. 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..f73e1dc1f0a67dbff3642df1e09e5518890fd743
--- /dev/null
+++ b/runtime/observatory/tests/service/step_test.dart
@@ -0,0 +1,49 @@
+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;
+ isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
Cutch 2016/11/09 14:48:49 Have you considered using helper routines from ser
+ stream.listen((ServiceEvent event) {
+ 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.");
+ completer.complete();
+ }
+ });
+ });
+
+ // We expect to start paused.
+ expect(isEventOfKind(isolate.pauseEvent, ServiceEvent.kPauseStart), true);
Cutch 2016/11/09 14:48:49 It's possible that the isolate hasn't paused at st
+
+ // Set breakpoint at the "var x = {};" line.
+ var rootLib = isolate.rootLibrary;
+ await rootLib.load();
+ isolate.addBreakpoint(rootLib.scripts[0], LINE_A);
+
+ // Resume (and step on every pause via the event stream listener above).
+ isolate.resume();
+
+ // The test is done once the completer is complete.
+ return completer.future;
+}
+
+var tests = [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