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 'dart:io'; | 7 import 'package:observatory/models.dart' as M; |
8 | 8 import 'package:observatory/service_io.dart'; |
| 9 import 'package:unittest/unittest.dart'; |
9 import 'service_test_common.dart'; | 10 import 'service_test_common.dart'; |
10 import 'test_helper.dart'; | 11 import 'test_helper.dart'; |
11 | 12 |
| 13 const LINE_A = 19; |
| 14 const LINE_B = 20; |
| 15 const LINE_C = 25; |
| 16 const LINE_D = 26; |
| 17 |
12 helper() async { | 18 helper() async { |
13 print('helper'); // LINE_A. | 19 print('helper'); // LINE_A. |
14 print('foobar'); // LINE_B. | 20 print('foobar'); // LINE_B. |
15 } | 21 } |
16 | 22 |
17 testMain() { | 23 testMain() { |
18 debugger(); | 24 debugger(); |
19 print('mmmmm'); // LINE_C. | 25 print('mmmmm'); // LINE_C. |
20 helper(); // LINE_D. | 26 helper(); // LINE_D. |
21 print('z'); | 27 print('z'); |
22 } | 28 } |
23 | 29 |
24 final ScriptLineParser lineParser = new ScriptLineParser(Platform.script); | |
25 | |
26 var tests = [ | 30 var tests = [ |
27 hasStoppedAtBreakpoint, | 31 hasStoppedAtBreakpoint, |
28 stoppedAtLine(lineParser.lineFor('LINE_C')), | 32 stoppedAtLine(LINE_C), |
29 stepOver, // print. | 33 stepOver, // print. |
30 hasStoppedAtBreakpoint, | 34 hasStoppedAtBreakpoint, |
31 stoppedAtLine(lineParser.lineFor('LINE_D')), | 35 stoppedAtLine(LINE_D), |
32 stepInto, | 36 stepInto, |
33 hasStoppedAtBreakpoint, | 37 hasStoppedAtBreakpoint, |
34 stoppedAtLine(lineParser.lineFor('LINE_A')), | 38 stoppedAtLine(LINE_A), |
35 stepOver, // print. | 39 stepOver, // print. |
36 hasStoppedAtBreakpoint, | 40 hasStoppedAtBreakpoint, |
37 stoppedAtLine(lineParser.lineFor('LINE_B')), | 41 stoppedAtLine(LINE_B), |
38 resumeIsolate | 42 resumeIsolate |
39 ]; | 43 ]; |
40 | 44 |
41 main(args) => | 45 main(args) => |
42 runIsolateTestsSynchronous(args, tests, testeeConcurrent: testMain); | 46 runIsolateTestsSynchronous(args, tests, testeeConcurrent: testMain); |
OLD | NEW |