| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug | 4 // VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug |
| 5 | 5 |
| 6 import 'package:observatory/service_io.dart'; | 6 import 'package:observatory/service_io.dart'; |
| 7 import 'test_helper.dart'; | 7 import 'test_helper.dart'; |
| 8 import 'dart:developer'; | 8 import 'dart:developer'; |
| 9 | 9 |
| 10 foo() async { } | 10 // :async_op will not be captured in this function because it never needs to |
| 11 | 11 // reschedule it. |
| 12 doAsync(stop) async { | 12 asyncWithoutAwait() async { |
| 13 if (stop) debugger(); | 13 print("asyncWithoutAwait"); |
| 14 await foo(); // Line 14. | |
| 15 await foo(); // Line 15. | |
| 16 await foo(); // Line 16. | |
| 17 return null; | |
| 18 } | 14 } |
| 19 | 15 |
| 20 testMain() { | 16 testMain() { |
| 21 // With two runs of doAsync floating around, async step should only cause | 17 debugger(); |
| 22 // us to stop in the run we started in. | 18 asyncWithoutAwait(); |
| 23 doAsync(false); | |
| 24 doAsync(true); | |
| 25 } | |
| 26 | |
| 27 asyncNext(Isolate isolate) async { | |
| 28 return isolate.asyncStepOver()[Isolate.kSecondResume]; | |
| 29 } | 19 } |
| 30 | 20 |
| 31 var tests = [ | 21 var tests = [ |
| 32 hasStoppedAtBreakpoint, | 22 hasStoppedAtBreakpoint, |
| 33 stoppedAtLine(14), | 23 stoppedAtLine(18), |
| 34 asyncNext, | 24 (isolate) => isolate.stepInto(), |
| 35 hasStoppedAtBreakpoint, | 25 hasStoppedAtBreakpoint, |
| 36 stoppedAtLine(15), | 26 (isolate) => isolate.getStack(), // Should not crash. |
| 37 asyncNext, | 27 // TODO(rmacnak): stoppedAtLine(12) |
| 38 hasStoppedAtBreakpoint, | 28 // This doesn't happen because asyncWithoutAwait is marked undebuggable. |
| 39 stoppedAtLine(16), | 29 // Probably needs to change to support async-step-into. |
| 40 resumeIsolate, | 30 resumeIsolate, |
| 41 ]; | 31 ]; |
| 42 | 32 |
| 43 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); | 33 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); |
| OLD | NEW |