| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 (Isolate isolate) async { | 68 (Isolate isolate) async { |
| 69 ServiceMap stack = await isolate.getStack(); | 69 ServiceMap stack = await isolate.getStack(); |
| 70 // Has causal frames (we are inside a function called by an async function) | 70 // Has causal frames (we are inside a function called by an async function) |
| 71 expect(stack['asyncCausalFrames'], isNotNull); | 71 expect(stack['asyncCausalFrames'], isNotNull); |
| 72 var asyncStack = stack['asyncCausalFrames']; | 72 var asyncStack = stack['asyncCausalFrames']; |
| 73 expect(asyncStack[0].toString(), contains('foobar')); | 73 expect(asyncStack[0].toString(), contains('foobar')); |
| 74 expect(asyncStack[1].kind, equals(M.FrameKind.asyncSuspensionMarker)); | 74 expect(asyncStack[1].kind, equals(M.FrameKind.asyncSuspensionMarker)); |
| 75 expect(asyncStack[2].toString(), contains('helper')); | 75 expect(asyncStack[2].toString(), contains('helper')); |
| 76 expect(asyncStack[3].kind, equals(M.FrameKind.asyncSuspensionMarker)); | 76 expect(asyncStack[3].kind, equals(M.FrameKind.asyncSuspensionMarker)); |
| 77 expect(asyncStack[4].toString(), contains('testMain')); | 77 expect(asyncStack[4].toString(), contains('testMain')); |
| 78 // Line 21. |
| 79 expect(await asyncStack[0].location.toUserString(), contains('.dart:21')); |
| 80 // Line 27. |
| 81 expect(await asyncStack[2].location.toUserString(), contains('.dart:27')); |
| 82 // Line 30. |
| 83 expect(await asyncStack[4].location.toUserString(), contains('.dart:33')); |
| 78 }, | 84 }, |
| 79 ]; | 85 ]; |
| 80 | 86 |
| 81 main(args) => runIsolateTestsSynchronous(args, | 87 main(args) => runIsolateTestsSynchronous(args, |
| 82 tests, | 88 tests, |
| 83 testeeConcurrent: testMain); | 89 testeeConcurrent: testMain); |
| OLD | NEW |