| 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 | 4 // VMOptions=--error_on_bad_type --error_on_bad_override |
| 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:async'; | 8 import 'dart:async'; |
| 9 import 'dart:developer'; | 9 import 'dart:developer'; |
| 10 import 'service_test_common.dart'; |
| 11 |
| 12 const int LINE_A = 19; |
| 10 | 13 |
| 11 foo() async { } | 14 foo() async { } |
| 12 bar() { } | 15 bar() { } |
| 13 | 16 |
| 14 doAsync(stop) async { | 17 doAsync(stop) async { |
| 15 if (stop) debugger(); | 18 if (stop) debugger(); |
| 16 await foo(); // Line 16. | 19 await foo(); // Line A. |
| 17 bar(); // Line 17. | 20 bar(); // Line A + 1. |
| 18 bar(); // Line 18. | 21 bar(); // Line A + 2. |
| 19 await foo(); // Line 19. | 22 await foo(); // Line A + 3. |
| 20 await foo(); // Line 20. | 23 await foo(); // Line A + 4. |
| 21 bar(); // Line 21. | 24 bar(); // Line A + 5. |
| 22 return null; | 25 return null; |
| 23 } | 26 } |
| 24 | 27 |
| 25 testMain() { | 28 testMain() { |
| 26 // With two runs of doAsync floating around, async step should only cause | 29 // With two runs of doAsync floating around, async step should only cause |
| 27 // us to stop in the run we started in. | 30 // us to stop in the run we started in. |
| 28 doAsync(false); | 31 doAsync(false); |
| 29 doAsync(true); | 32 doAsync(true); |
| 30 } | 33 } |
| 31 | 34 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 48 if (isolate.pauseEvent.atAsyncSuspension) { | 51 if (isolate.pauseEvent.atAsyncSuspension) { |
| 49 print("next-async"); | 52 print("next-async"); |
| 50 return asyncStepOver(isolate); | 53 return asyncStepOver(isolate); |
| 51 } else { | 54 } else { |
| 52 print("next-sync"); | 55 print("next-sync"); |
| 53 return stepOverAwaitingResume(isolate); | 56 return stepOverAwaitingResume(isolate); |
| 54 } | 57 } |
| 55 } | 58 } |
| 56 | 59 |
| 57 var tests = [ | 60 var tests = [ |
| 58 hasStoppedAtBreakpoint, stoppedAtLine(16), // foo() | 61 hasStoppedAtBreakpoint, stoppedAtLine(LINE_A), // foo() |
| 59 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(16), // await | 62 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A), // await |
| 60 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(17), // bar() | 63 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 1), // bar() |
| 61 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(18), // bar() | 64 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 2), // bar() |
| 62 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(19), // foo() | 65 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 3), // foo() |
| 63 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(19), // await | 66 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 3), // await |
| 64 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(20), // foo() | 67 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 4), // foo() |
| 65 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(20), // await | 68 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 4), // await |
| 66 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(21), // bar() | 69 smartNext, hasStoppedAtBreakpoint, stoppedAtLine(LINE_A + 5), // bar() |
| 67 resumeIsolate, | 70 resumeIsolate, |
| 68 ]; | 71 ]; |
| 69 | 72 |
| 70 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); | 73 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); |
| OLD | NEW |