OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016, 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/service_io.dart'; |
| 8 import 'package:unittest/unittest.dart'; |
| 9 import 'service_test_common.dart'; |
| 10 import 'test_helper.dart'; |
| 11 |
| 12 helper() async { // Line 12, Col 16 is the open brace. |
| 13 } |
| 14 |
| 15 testMain() { |
| 16 debugger(); |
| 17 helper(); // Line 17, Col 3 is the position of the function call. |
| 18 } |
| 19 |
| 20 var tests = [ |
| 21 hasStoppedAtBreakpoint, |
| 22 stoppedAtLine(17), |
| 23 stepInto, |
| 24 |
| 25 (Isolate isolate) async { |
| 26 ServiceMap stack = await isolate.getStack(); |
| 27 expect(stack['frames'].length, greaterThan(3)); |
| 28 |
| 29 var frame = stack['frames'][0]; |
| 30 expect(frame.function.name, equals('Completer.sync')); |
| 31 expect(await frame.location.getLine(), greaterThan(0)); |
| 32 expect(await frame.location.getColumn(), greaterThan(0)); |
| 33 |
| 34 // We used to return a negative token position for this frame. |
| 35 // See issue #27128. |
| 36 frame = stack['frames'][1]; |
| 37 expect(frame.function.name, equals('helper')); |
| 38 expect(await frame.location.getLine(), equals(12)); |
| 39 expect(await frame.location.getColumn(), equals(16)); |
| 40 |
| 41 frame = stack['frames'][2]; |
| 42 expect(frame.function.name, equals('testMain')); |
| 43 expect(await frame.location.getLine(), equals(17)); |
| 44 expect(await frame.location.getColumn(), equals(3)); |
| 45 } |
| 46 ]; |
| 47 |
| 48 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); |
OLD | NEW |