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 foo() async { } |
11 | 11 |
12 doAsync(stop) async { | 12 doAsync(stop) async { |
13 if (stop) debugger(); | 13 if (stop) debugger(); |
14 await foo(); // Line 14. | 14 await foo(); // Line 14. |
15 await foo(); // Line 15. | 15 await foo(); // Line 15. |
16 await foo(); // Line 16. | 16 await foo(); // Line 16. |
17 return null; | 17 return null; |
18 } | 18 } |
19 | 19 |
20 testMain() { | 20 testMain() { |
21 // With two runs of doAsync floating around, async step should only cause | 21 // With two runs of doAsync floating around, async step should only cause |
22 // us to stop in the run we started in. | 22 // us to stop in the run we started in. |
23 doAsync(false); | 23 doAsync(false); |
24 doAsync(true); | 24 doAsync(true); |
25 } | 25 } |
26 | 26 |
27 asyncNext(Isolate isolate) async { | 27 asyncNext(Isolate isolate) async { |
28 print('asyncNext'); | 28 print('asyncNext'); |
29 List asyncStepFutures = await isolate.asyncStepOver(); | 29 return asyncStepOver(isolate); |
30 return asyncStepFutures[Isolate.kSecondResume]; | |
31 } | 30 } |
32 | 31 |
33 var tests = [ | 32 var tests = [ |
34 hasStoppedAtBreakpoint, | 33 hasStoppedAtBreakpoint, |
35 stoppedAtLine(14), | 34 stoppedAtLine(14), |
| 35 stepOver, // foo() |
36 asyncNext, | 36 asyncNext, |
37 hasStoppedAtBreakpoint, | 37 hasStoppedAtBreakpoint, |
38 stoppedAtLine(15), | 38 stoppedAtLine(15), |
| 39 stepOver, // foo() |
39 asyncNext, | 40 asyncNext, |
40 hasStoppedAtBreakpoint, | 41 hasStoppedAtBreakpoint, |
41 stoppedAtLine(16), | 42 stoppedAtLine(16), |
42 resumeIsolate, | 43 resumeIsolate, |
43 ]; | 44 ]; |
44 | 45 |
45 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); | 46 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); |
OLD | NEW |