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 = 21; |
| 14 const LINE_B = 22; |
| 15 const LINE_C = 26; |
| 16 const LINE_D = 29; |
| 17 const LINE_E = 35; |
| 18 const LINE_F = 36; |
| 19 |
| 20 foobar() async* { |
| 21 yield 1; // LINE_A. |
| 22 yield 2; // LINE_B. |
| 23 } |
| 24 |
| 25 helper() async { |
| 26 print('helper'); // LINE_C. |
| 27 await for (var i in foobar()) { |
| 28 debugger(); |
| 29 print('loop'); // LINE_D. |
| 30 } |
| 31 } |
| 32 |
| 33 testMain() { |
| 34 debugger(); |
| 35 print('mmmmm'); // LINE_E. |
| 36 helper(); // LINE_F. |
| 37 print('z'); |
| 38 } |
| 39 |
| 40 var tests = [ |
| 41 hasStoppedAtBreakpoint, |
| 42 stoppedAtLine(LINE_E), |
| 43 stepOver, // print. |
| 44 hasStoppedAtBreakpoint, |
| 45 stoppedAtLine(LINE_F), |
| 46 stepInto, |
| 47 hasStoppedAtBreakpoint, |
| 48 stoppedAtLine(LINE_C), |
| 49 stepOver, // print. |
| 50 hasStoppedAtBreakpoint, |
| 51 stepInto, |
| 52 hasStoppedAtBreakpoint, |
| 53 stoppedAtLine(LINE_A), |
| 54 // Resume here to exit the generator function. |
| 55 // TODO(johnmccutchan): Implement support for step-out of async functions. |
| 56 resumeIsolate, |
| 57 hasStoppedAtBreakpoint, |
| 58 stoppedAtLine(LINE_D), |
| 59 stepOver, // print. |
| 60 hasStoppedAtBreakpoint, |
| 61 stepInto, |
| 62 hasStoppedAtBreakpoint, |
| 63 stoppedAtLine(LINE_B), |
| 64 resumeIsolate, |
| 65 ]; |
| 66 |
| 67 main(args) => |
| 68 runIsolateTestsSynchronous(args, tests, testeeConcurrent: testMain); |
OLD | NEW |