| 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 | 4 // VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug |
| 5 | 5 |
| 6 import 'dart:async'; |
| 6 import 'dart:developer'; | 7 import 'dart:developer'; |
| 7 import 'package:observatory/models.dart' as M; | 8 import 'package:observatory/models.dart' as M; |
| 8 import 'package:observatory/service_io.dart'; | 9 import 'package:observatory/service_io.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| 10 import 'service_test_common.dart'; | 11 import 'service_test_common.dart'; |
| 11 import 'test_helper.dart'; | 12 import 'test_helper.dart'; |
| 12 | 13 |
| 13 const LINE_A = 20; | 14 const LINE_A = 23; |
| 14 const LINE_B = 21; | 15 const LINE_B = 24; |
| 15 const LINE_C = 26; | 16 const LINE_C = 30; |
| 16 const LINE_D = 27; | 17 const LINE_D = 32; |
| 17 const LINE_E = 28; | 18 const LINE_E = 35; |
| 18 const LINE_F = 35; | 19 const LINE_F = 38; |
| 19 const LINE_G = 38; | 20 const LINE_G = 40; |
| 20 | 21 |
| 21 helper() async { | 22 helper() async { |
| 22 print('helper'); // LINE_A. | 23 print('helper'); // LINE_A. |
| 23 throw 'a'; // LINE_B. | 24 throw 'a'; // LINE_B. |
| 25 return null; |
| 24 } | 26 } |
| 25 | 27 |
| 26 testMain() async { | 28 testMain() async { |
| 27 debugger(); | 29 debugger(); |
| 28 print('mmmmm'); // LINE_C. | 30 print('mmmmm'); // LINE_C. |
| 29 try { | 31 try { |
| 30 await helper(); // LINE_D. | 32 await helper(); // LINE_D. |
| 31 } catch (e) { | 33 } catch (e) { |
| 32 // arrive here on error. | 34 // arrive here on error. |
| 33 print('error: $e'); // LINE_E. | 35 print('error: $e'); // LINE_E. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 45 hasStoppedAtBreakpoint, | 47 hasStoppedAtBreakpoint, |
| 46 stoppedAtLine(LINE_D), | 48 stoppedAtLine(LINE_D), |
| 47 stepInto, | 49 stepInto, |
| 48 hasStoppedAtBreakpoint, | 50 hasStoppedAtBreakpoint, |
| 49 stoppedAtLine(LINE_A), | 51 stoppedAtLine(LINE_A), |
| 50 stepOver, // print. | 52 stepOver, // print. |
| 51 hasStoppedAtBreakpoint, | 53 hasStoppedAtBreakpoint, |
| 52 stoppedAtLine(LINE_B), // throw 'a'. | 54 stoppedAtLine(LINE_B), // throw 'a'. |
| 53 stepInto, // exit helper via a throw. | 55 stepInto, // exit helper via a throw. |
| 54 hasStoppedAtBreakpoint, | 56 hasStoppedAtBreakpoint, |
| 57 stepInto, // exit helper via a throw. |
| 58 hasStoppedAtBreakpoint, |
| 59 stepInto, // step once from entry to main. |
| 60 hasStoppedAtBreakpoint, |
| 55 stoppedAtLine(LINE_E), // print(error) | 61 stoppedAtLine(LINE_E), // print(error) |
| 56 stepOver, | 62 stepOver, |
| 57 hasStoppedAtBreakpoint, | 63 hasStoppedAtBreakpoint, |
| 64 stepOver, |
| 65 hasStoppedAtBreakpoint, |
| 58 stoppedAtLine(LINE_F), // print(foo) | 66 stoppedAtLine(LINE_F), // print(foo) |
| 59 stepOver, | 67 stepOver, |
| 60 hasStoppedAtBreakpoint, | 68 hasStoppedAtBreakpoint, |
| 61 stoppedAtLine(LINE_G), // print(z) | 69 stoppedAtLine(LINE_G), // print(z) |
| 62 resumeIsolate | 70 resumeIsolate |
| 63 ]; | 71 ]; |
| 64 | 72 |
| 65 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); | 73 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); |
| OLD | NEW |