Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 | 58 |
| 59 (Isolate isolate) async { | 59 (Isolate isolate) async { |
| 60 ServiceMap stack = await isolate.getStack(); | 60 ServiceMap stack = await isolate.getStack(); |
| 61 // 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) |
| 62 expect(stack['asyncCausalFrames'], isNotNull); | 62 expect(stack['asyncCausalFrames'], isNotNull); |
| 63 var asyncStack = stack['asyncCausalFrames']; | 63 var asyncStack = stack['asyncCausalFrames']; |
| 64 expect(asyncStack[0].toString(), contains('foobar')); | 64 expect(asyncStack[0].toString(), contains('foobar')); |
| 65 expect(asyncStack[1].toString(), contains('helper')); | 65 expect(asyncStack[1].toString(), contains('helper')); |
| 66 expect(asyncStack[2].kind, equals(M.FrameKind.asyncSuspensionMarker)); | 66 expect(asyncStack[2].kind, equals(M.FrameKind.asyncSuspensionMarker)); |
| 67 expect(asyncStack[3].toString(), contains('testMain')); | 67 expect(asyncStack[3].toString(), contains('testMain')); |
| 68 // Line 19. | |
| 69 expect(await asyncStack[0].location.toUserString(), contains(':19:')); | |
|
hausner
2017/02/15 08:36:54
DBC: you could use string interpolation to avoid t
| |
| 70 // Line 25. | |
| 71 expect(await asyncStack[1].location.toUserString(), contains(':25:')); | |
| 72 // Line 30. | |
| 73 expect(await asyncStack[3].location.toUserString(), contains(':30:')); | |
| 68 }, | 74 }, |
| 69 ]; | 75 ]; |
| 70 | 76 |
| 71 main(args) => runIsolateTestsSynchronous(args, | 77 main(args) => runIsolateTestsSynchronous(args, |
| 72 tests, | 78 tests, |
| 73 testeeConcurrent: testMain); | 79 testeeConcurrent: testMain); |
| OLD | NEW |