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

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

Issue 2291293003: Fix evaluating in async/sync*/async* methods. (Closed)
Patch Set: Created 4 years, 4 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/evaluate_in_sync_star_activation_test.dart
diff --git a/runtime/observatory/tests/service/evaluate_in_sync_star_activation_test.dart b/runtime/observatory/tests/service/evaluate_in_sync_star_activation_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5ce7463fc6f958cbc04a6cc1123fa811767b55e4
--- /dev/null
+++ b/runtime/observatory/tests/service/evaluate_in_sync_star_activation_test.dart
@@ -0,0 +1,62 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:async';
+import 'dart:developer';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'service_test_common.dart';
+import 'test_helper.dart';
+
+generator() sync* {
+ var x = 3;
+ var y = 4;
+ debugger();
+ yield y;
+ var z = x + y;
+ debugger();
+ yield z;
+}
+
+testFunction() {
+ for (var ignored in generator());
+}
+
+var tests = [
+
+hasStoppedAtBreakpoint,
+
+(Isolate isolate) async {
+ // Make sure we are in the right place.
+ var stack = await isolate.getStack();
+ var topFrame = 0;
+ expect(stack.type, equals('Stack'));
+ expect(await stack['frames'][topFrame].location.getLine(), 16);
+
+ var result = await isolate.evalFrame(topFrame, "x");
+ print(result);
+ expect(result.valueAsString, equals("3"));
+},
+
+resumeIsolate,
+
+hasStoppedAtBreakpoint,
+
+(Isolate isolate) async {
+ // Make sure we are in the right place.
+ var stack = await isolate.getStack();
+ var topFrame = 0;
+ expect(stack.type, equals('Stack'));
+ expect(await stack['frames'][topFrame].location.getLine(), 19);
+
+ var result = await isolate.evalFrame(topFrame, "z");
+ print(result);
+ expect(result.valueAsString, equals("7"));
+},
+
+resumeIsolate,
+
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
« no previous file with comments | « runtime/observatory/tests/service/evaluate_in_async_star_activation_test.dart ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698