| 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 = 24; | |
| 14 const LINE_B = 25; | |
| 15 const LINE_C = 29; | |
| 16 const LINE_D = 32; | |
| 17 const LINE_E = 39; | |
| 18 const LINE_F = 40; | |
| 19 const LINE_G = 41; | |
| 20 const LINE_H = 30; | |
| 21 const LINE_I = 34; | |
| 22 | |
| 23 foobar() async* { | 12 foobar() async* { |
| 24 yield 1; // LINE_A. | 13 yield 1; // LINE_A. |
| 25 yield 2; // LINE_B. | 14 yield 2; // LINE_B. |
| 26 } | 15 } |
| 27 | 16 |
| 28 helper() async { | 17 helper() async { |
| 29 print('helper'); // LINE_C. | 18 print('helper'); // LINE_C. |
| 30 await for (var i in foobar()) { // LINE_H. | 19 await for (var i in foobar()) /* LINE_H */ { |
| 31 debugger(); | 20 debugger(); |
| 32 print('loop'); // LINE_D. | 21 print('loop'); // LINE_D. |
| 33 } | 22 } |
| 34 return null; // LINE_I. | 23 return null; // LINE_I. |
| 35 } | 24 } |
| 36 | 25 |
| 37 testMain() { | 26 testMain() { |
| 38 debugger(); | 27 debugger(); |
| 39 print('mmmmm'); // LINE_E. | 28 print('mmmmm'); // LINE_E. |
| 40 helper(); // LINE_F. | 29 helper(); // LINE_F. |
| 41 print('z'); // LINE_G. | 30 print('z'); // LINE_G. |
| 42 } | 31 } |
| 43 | 32 |
| 33 final ScriptLineParser lineParser = new ScriptLineParser(Platform.script); |
| 34 |
| 44 var tests = [ | 35 var tests = [ |
| 45 hasStoppedAtBreakpoint, | 36 hasStoppedAtBreakpoint, |
| 46 stoppedAtLine(LINE_E), | 37 stoppedAtLine(lineParser.lineFor('LINE_E')), |
| 47 stepOver, // print. | 38 stepOver, // print. |
| 48 hasStoppedAtBreakpoint, | 39 hasStoppedAtBreakpoint, |
| 49 stoppedAtLine(LINE_F), | 40 stoppedAtLine(lineParser.lineFor('LINE_F')), |
| 50 stepInto, | 41 stepInto, |
| 51 hasStoppedAtBreakpoint, | 42 hasStoppedAtBreakpoint, |
| 52 stoppedAtLine(LINE_C), | 43 stoppedAtLine(lineParser.lineFor('LINE_C')), |
| 53 stepOver, // print. | 44 stepOver, // print. |
| 54 hasStoppedAtBreakpoint, | 45 hasStoppedAtBreakpoint, |
| 55 stepInto, | 46 stepInto, |
| 56 hasStoppedAtBreakpoint, | 47 hasStoppedAtBreakpoint, |
| 57 stoppedAtLine(LINE_A), | 48 stoppedAtLine(lineParser.lineFor('LINE_A')), |
| 58 stepOut, // step out of generator. | 49 stepOut, // step out of generator. |
| 59 hasStoppedAtBreakpoint, | 50 hasStoppedAtBreakpoint, |
| 60 stoppedAtLine(LINE_H), // await for. | 51 stoppedAtLine(lineParser.lineFor('LINE_H')), // await for. |
| 61 stepInto, | 52 stepInto, |
| 62 hasStoppedAtBreakpoint, // debugger(). | 53 hasStoppedAtBreakpoint, // debugger(). |
| 63 stepInto, | 54 stepInto, |
| 64 hasStoppedAtBreakpoint, | 55 hasStoppedAtBreakpoint, |
| 65 stoppedAtLine(LINE_D), // print. | 56 stoppedAtLine(lineParser.lineFor('LINE_D')), // print. |
| 66 stepInto, | 57 stepInto, |
| 67 hasStoppedAtBreakpoint, // await for. | 58 hasStoppedAtBreakpoint, // await for. |
| 68 stepInto, | 59 stepInto, |
| 69 hasStoppedAtBreakpoint, // back in generator. | 60 hasStoppedAtBreakpoint, // back in generator. |
| 70 stoppedAtLine(LINE_B), | 61 stoppedAtLine(lineParser.lineFor('LINE_B')), |
| 71 stepOut, // step out of generator. | 62 stepOut, // step out of generator. |
| 72 hasStoppedAtBreakpoint, | 63 hasStoppedAtBreakpoint, |
| 73 stoppedAtLine(LINE_H), // await for. | 64 stoppedAtLine(lineParser.lineFor('LINE_H')), // await for. |
| 74 stepInto, | 65 stepInto, |
| 75 hasStoppedAtBreakpoint, // debugger(). | 66 hasStoppedAtBreakpoint, // debugger(). |
| 76 stepInto, | 67 stepInto, |
| 77 hasStoppedAtBreakpoint, | 68 hasStoppedAtBreakpoint, |
| 78 stoppedAtLine(LINE_D), // print. | 69 stoppedAtLine(lineParser.lineFor('LINE_D')), // print. |
| 79 stepInto, | 70 stepInto, |
| 80 hasStoppedAtBreakpoint, | 71 hasStoppedAtBreakpoint, |
| 81 stoppedAtLine(LINE_H), // await for. | 72 stoppedAtLine(lineParser.lineFor('LINE_H')), // await for. |
| 82 stepInto, | 73 stepInto, |
| 83 hasStoppedAtBreakpoint, | 74 hasStoppedAtBreakpoint, |
| 84 stepOut, // step out of generator. | 75 stepOut, // step out of generator. |
| 85 hasStoppedAtBreakpoint, | 76 hasStoppedAtBreakpoint, |
| 86 stoppedAtLine(LINE_I), // return null. | 77 stoppedAtLine(lineParser.lineFor('LINE_I')), // return null. |
| 87 ]; | 78 ]; |
| 88 | 79 |
| 89 main(args) => | 80 main(args) => |
| 90 runIsolateTestsSynchronous(args, tests, testeeConcurrent: testMain); | 81 runIsolateTestsSynchronous(args, tests, testeeConcurrent: testMain); |
| OLD | NEW |