Index: runtime/observatory/tests/service/evaluate_in_async_star_activation_test.dart |
diff --git a/runtime/observatory/tests/service/evaluate_in_async_star_activation_test.dart b/runtime/observatory/tests/service/evaluate_in_async_star_activation_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..de9b3972b355c74bb96fd6fe6a4e3bbe9091639c |
--- /dev/null |
+++ b/runtime/observatory/tests/service/evaluate_in_async_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() async* { |
+ var x = 3; |
+ var y = 4; |
+ debugger(); |
+ yield y; |
+ var z = x + y; |
+ debugger(); |
+ yield z; |
+} |
+ |
+testFunction() async { |
+ await 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); |