OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // VMOptions=--error_on_bad_type --error_on_bad_override --verbose_debug |
| 5 |
| 6 import 'dart:developer'; |
| 7 import 'package:observatory/models.dart' as M; |
| 8 import 'package:observatory/service_io.dart'; |
| 9 import 'package:unittest/unittest.dart'; |
| 10 import 'service_test_common.dart'; |
| 11 import 'test_helper.dart'; |
| 12 |
| 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 const LINE_F = 35; |
| 19 const LINE_G = 38; |
| 20 |
| 21 helper() async { |
| 22 print('helper'); // LINE_A. |
| 23 throw 'a'; // LINE_B. |
| 24 } |
| 25 |
| 26 testMain() async { |
| 27 debugger(); |
| 28 print('mmmmm'); // LINE_C. |
| 29 try { |
| 30 await helper(); // LINE_D. |
| 31 } catch (e) { |
| 32 // arrive here on error. |
| 33 print('error: $e'); // LINE_E. |
| 34 } finally { |
| 35 // arrive here in both cases. |
| 36 print('foo'); // LINE_F. |
| 37 } |
| 38 print('z'); // LINE_G. |
| 39 } |
| 40 |
| 41 var tests = [ |
| 42 hasStoppedAtBreakpoint, |
| 43 stoppedAtLine(LINE_C), |
| 44 stepOver, // print. |
| 45 hasStoppedAtBreakpoint, |
| 46 stoppedAtLine(LINE_D), |
| 47 stepInto, |
| 48 hasStoppedAtBreakpoint, |
| 49 stoppedAtLine(LINE_A), |
| 50 stepOver, // print. |
| 51 hasStoppedAtBreakpoint, |
| 52 stoppedAtLine(LINE_B), // throw 'a'. |
| 53 stepInto, // exit helper via a throw. |
| 54 hasStoppedAtBreakpoint, |
| 55 stoppedAtLine(LINE_E), // print(error) |
| 56 stepOver, |
| 57 hasStoppedAtBreakpoint, |
| 58 stoppedAtLine(LINE_F), // print(foo) |
| 59 stepOver, |
| 60 hasStoppedAtBreakpoint, |
| 61 stoppedAtLine(LINE_G), // print(z) |
| 62 resumeIsolate |
| 63 ]; |
| 64 |
| 65 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); |
OLD | NEW |