| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 --asyn
c_debugger | 4 // VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug --asyn
c_debugger |
| 5 | 5 |
| 6 import 'dart:developer'; | 6 import 'dart:developer'; |
| 7 import 'package:observatory/models.dart' as M; | 7 import 'dart:io'; |
| 8 import 'package:observatory/service_io.dart'; | 8 |
| 9 import 'package:unittest/unittest.dart'; | |
| 10 import 'service_test_common.dart'; | 9 import 'service_test_common.dart'; |
| 11 import 'test_helper.dart'; | 10 import 'test_helper.dart'; |
| 12 | 11 |
| 13 const LINE_A = 20; | |
| 14 const LINE_B = 21; | |
| 15 const LINE_C = 26; | |
| 16 const LINE_D = 27; | |
| 17 const LINE_E = 28; | |
| 18 | |
| 19 helper() async { | 12 helper() async { |
| 20 print('helper'); // LINE_A. | 13 print('helper'); // LINE_A. |
| 21 return null; // LINE_B. | 14 return null; // LINE_B. |
| 22 } | 15 } |
| 23 | 16 |
| 24 testMain() async { | 17 testMain() async { |
| 25 debugger(); | 18 debugger(); |
| 26 print('mmmmm'); // LINE_C. | 19 print('mmmmm'); // LINE_C. |
| 27 await helper(); // LINE_D. | 20 await helper(); // LINE_D. |
| 28 print('z'); // LINE_E. | 21 print('z'); // LINE_E. |
| 29 } | 22 } |
| 30 | 23 |
| 24 final ScriptLineParser lineParser = new ScriptLineParser(Platform.script); |
| 25 |
| 31 var tests = [ | 26 var tests = [ |
| 32 hasStoppedAtBreakpoint, | 27 hasStoppedAtBreakpoint, |
| 33 stoppedAtLine(LINE_C), | 28 stoppedAtLine(lineParser.lineFor('LINE_C')), |
| 34 stepOver, // print. | 29 stepOver, // print. |
| 35 hasStoppedAtBreakpoint, | 30 hasStoppedAtBreakpoint, |
| 36 stoppedAtLine(LINE_D), | 31 stoppedAtLine(lineParser.lineFor('LINE_D')), |
| 37 stepInto, | 32 stepInto, |
| 38 hasStoppedAtBreakpoint, | 33 hasStoppedAtBreakpoint, |
| 39 stoppedAtLine(LINE_A), | 34 stoppedAtLine(lineParser.lineFor('LINE_A')), |
| 40 stepOver, // print. | 35 stepOver, // print. |
| 41 hasStoppedAtBreakpoint, | 36 hasStoppedAtBreakpoint, |
| 42 stoppedAtLine(LINE_B), // return null. | 37 stoppedAtLine(lineParser.lineFor('LINE_B')), // return null. |
| 43 stepInto, // exit helper via a single step. | 38 stepInto, // exit helper via a single step. |
| 44 hasStoppedAtBreakpoint, | 39 hasStoppedAtBreakpoint, |
| 45 stoppedAtLine(LINE_E), // arrive after the await. | 40 stoppedAtLine(lineParser.lineFor('LINE_E')), // arrive after the await. |
| 46 resumeIsolate | 41 resumeIsolate |
| 47 ]; | 42 ]; |
| 48 | 43 |
| 49 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); | 44 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); |
| OLD | NEW |