| 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:developer'; | 6 import 'dart:developer'; |
| 7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
| 8 import 'package:observatory/service_io.dart'; | 8 import 'package:observatory/service_io.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 import 'service_test_common.dart'; | 10 import 'service_test_common.dart'; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 }, | 40 }, |
| 41 resumeIsolate, | 41 resumeIsolate, |
| 42 hasStoppedAtBreakpoint, | 42 hasStoppedAtBreakpoint, |
| 43 stoppedAtLine(LINE_A), | 43 stoppedAtLine(LINE_A), |
| 44 | 44 |
| 45 (Isolate isolate) async { | 45 (Isolate isolate) async { |
| 46 ServiceMap stack = await isolate.getStack(); | 46 ServiceMap stack = await isolate.getStack(); |
| 47 // Has causal frames (we are inside an async function) | 47 // Has causal frames (we are inside an async function) |
| 48 expect(stack['asyncCausalFrames'], isNotNull); | 48 expect(stack['asyncCausalFrames'], isNotNull); |
| 49 var asyncStack = stack['asyncCausalFrames']; | 49 var asyncStack = stack['asyncCausalFrames']; |
| 50 expect(asyncStack[0].toString(), contains('helper_async_body')); | 50 expect(asyncStack[0].toString(), contains('helper')); |
| 51 expect(asyncStack[1].kind, equals(M.FrameKind.asyncSuspensionMarker)); | 51 expect(asyncStack[1].kind, equals(M.FrameKind.asyncSuspensionMarker)); |
| 52 expect(asyncStack[2].toString(), contains('helper')); | 52 expect(asyncStack[2].toString(), contains('testMain')); |
| 53 expect(asyncStack[3].toString(), contains('testMain')); | |
| 54 }, | 53 }, |
| 55 | 54 |
| 56 resumeIsolate, | 55 resumeIsolate, |
| 57 hasStoppedAtBreakpoint, | 56 hasStoppedAtBreakpoint, |
| 58 stoppedAtLine(LINE_C), | 57 stoppedAtLine(LINE_C), |
| 59 | 58 |
| 60 (Isolate isolate) async { | 59 (Isolate isolate) async { |
| 61 ServiceMap stack = await isolate.getStack(); | 60 ServiceMap stack = await isolate.getStack(); |
| 62 // Has causal frames (we are inside a function called by an async function) | 61 // Has causal frames (we are inside a function called by an async function) |
| 63 expect(stack['asyncCausalFrames'], isNotNull); | 62 expect(stack['asyncCausalFrames'], isNotNull); |
| 64 var asyncStack = stack['asyncCausalFrames']; | 63 var asyncStack = stack['asyncCausalFrames']; |
| 65 expect(asyncStack[0].toString(), contains('foobar')); | 64 expect(asyncStack[0].toString(), contains('foobar')); |
| 66 expect(asyncStack[1].toString(), contains('helper_async_body')); | 65 expect(asyncStack[1].toString(), contains('helper')); |
| 67 expect(asyncStack[2].kind, equals(M.FrameKind.asyncSuspensionMarker)); | 66 expect(asyncStack[2].kind, equals(M.FrameKind.asyncSuspensionMarker)); |
| 68 expect(asyncStack[3].toString(), contains('helper')); | 67 expect(asyncStack[3].toString(), contains('testMain')); |
| 69 }, | 68 }, |
| 70 ]; | 69 ]; |
| 71 | 70 |
| 72 main(args) => runIsolateTestsSynchronous(args, | 71 main(args) => runIsolateTestsSynchronous(args, |
| 73 tests, | 72 tests, |
| 74 testeeConcurrent: testMain); | 73 testeeConcurrent: testMain); |
| OLD | NEW |