| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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=--compile_all --error_on_bad_type --error_on_bad_override | 4 // VMOptions=--compile_all --error_on_bad_type --error_on_bad_override |
| 5 | 5 |
| 6 import 'dart:async'; | |
| 7 import 'dart:developer'; | 6 import 'dart:developer'; |
| 8 import 'package:observatory/service_io.dart'; | 7 import 'package:observatory/service_io.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
| 10 import 'test_helper.dart'; | 9 import 'test_helper.dart'; |
| 11 | 10 |
| 12 foo() {} | 11 foo() {} |
| 13 | 12 |
| 14 doAsync(param1) async { | 13 doAsync(param1) async { |
| 15 var local1 = param1 + 1; | 14 var local1 = param1 + 1; |
| 16 foo(); // Line 16 | 15 foo(); // Line 15 |
| 17 await null; | 16 await local1; |
| 18 } | 17 } |
| 19 | 18 |
| 20 doAsyncStar(param2) async* { | 19 doAsyncStar(param2) async* { |
| 21 var local2 = param2 + 1; | 20 var local2 = param2 + 1; |
| 22 foo(); // Line 22 | 21 foo(); // Line 21 |
| 23 yield null; | 22 yield local2; |
| 24 } | 23 } |
| 25 | 24 |
| 26 testeeDo() { | 25 testeeDo() { |
| 27 debugger(); | 26 debugger(); |
| 28 | 27 |
| 29 doAsync(1).then((_) { | 28 doAsync(1).then((_) { |
| 30 doAsyncStar(1).listen((_) {}); | 29 doAsyncStar(1).listen((_) {}); |
| 31 }); | 30 }); |
| 32 } | 31 } |
| 33 | 32 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 47 expect(stack.type, equals('Stack')); | 46 expect(stack.type, equals('Stack')); |
| 48 expect(stack['frames'].length, greaterThanOrEqualTo(1)); | 47 expect(stack['frames'].length, greaterThanOrEqualTo(1)); |
| 49 Frame frame = stack['frames'][0]; | 48 Frame frame = stack['frames'][0]; |
| 50 var vars = frame.variables.map((v) => v['name']).join(' '); | 49 var vars = frame.variables.map((v) => v['name']).join(' '); |
| 51 expect(vars, equals('param2 local2')); // no :async_op et al | 50 expect(vars, equals('param2 local2')); // no :async_op et al |
| 52 } | 51 } |
| 53 | 52 |
| 54 | 53 |
| 55 var tests = [ | 54 var tests = [ |
| 56 hasStoppedAtBreakpoint, // debugger() | 55 hasStoppedAtBreakpoint, // debugger() |
| 57 setBreakpointAtLine(16), | 56 setBreakpointAtLine(15), |
| 58 setBreakpointAtLine(22), | 57 setBreakpointAtLine(21), |
| 59 resumeIsolate, | 58 resumeIsolate, |
| 60 | 59 |
| 61 hasStoppedAtBreakpoint, | 60 hasStoppedAtBreakpoint, |
| 62 stoppedAtLine(16), | 61 stoppedAtLine(15), |
| 63 checkAsyncVarDescriptors, | 62 checkAsyncVarDescriptors, |
| 64 resumeIsolate, | 63 resumeIsolate, |
| 65 | 64 |
| 66 hasStoppedAtBreakpoint, | 65 hasStoppedAtBreakpoint, |
| 67 stoppedAtLine(22), | 66 stoppedAtLine(21), |
| 68 checkAsyncStarVarDescriptors, | 67 checkAsyncStarVarDescriptors, |
| 69 resumeIsolate, | 68 resumeIsolate, |
| 70 ]; | 69 ]; |
| 71 | 70 |
| 72 main(args) => runIsolateTests(args, tests, testeeConcurrent: testeeDo); | 71 main(args) => runIsolateTests(args, tests, testeeConcurrent: testeeDo); |
| OLD | NEW |