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 --verbos
e_debug | 4 // VMOptions=--compile_all --error_on_bad_type --error_on_bad_override --verbos
e_debug |
5 | 5 |
6 import 'package:observatory/service_io.dart'; | 6 import 'package:observatory/service_io.dart'; |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import 'test_helper.dart'; | 8 import 'test_helper.dart'; |
9 import 'dart:developer'; | 9 import 'dart:developer'; |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 var function = rootLib.functions.singleWhere((f) => f.name == 'testFunction'); | 33 var function = rootLib.functions.singleWhere((f) => f.name == 'testFunction'); |
34 | 34 |
35 var bpt = await isolate.addBreakpointAtEntry(function); | 35 var bpt = await isolate.addBreakpointAtEntry(function); |
36 expect(bpt is Breakpoint, isTrue); | 36 expect(bpt is Breakpoint, isTrue); |
37 print(bpt); | 37 print(bpt); |
38 }, | 38 }, |
39 | 39 |
40 resumeIsolate, | 40 resumeIsolate, |
41 | 41 |
42 hasStoppedAtBreakpoint, | 42 hasStoppedAtBreakpoint, |
43 | 43 stoppedAtLine(11), |
44 // We are at the breakpoint on line 11. | |
45 (Isolate isolate) async { | |
46 ServiceMap stack = await isolate.getStack(); | |
47 expect(stack.type, equals('Stack')); | |
48 expect(stack['frames'].length, greaterThanOrEqualTo(1)); | |
49 | |
50 Script script = stack['frames'][0].location.script; | |
51 expect(stack['frames'][0].location.tokenPos, equals(22)); | |
52 }, | |
53 | |
54 resumeIsolate, | 44 resumeIsolate, |
55 | 45 |
56 hasStoppedAtBreakpoint, | 46 hasStoppedAtBreakpoint, |
57 | 47 stoppedAtLine(11), |
58 // We are at the breakpoint on line 11. | |
59 (Isolate isolate) async { | |
60 ServiceMap stack = await isolate.getStack(); | |
61 expect(stack.type, equals('Stack')); | |
62 expect(stack['frames'].length, greaterThanOrEqualTo(1)); | |
63 | |
64 Script script = stack['frames'][0].location.script; | |
65 expect(stack['frames'][0].location.tokenPos, equals(22)); | |
66 }, | |
67 | |
68 resumeIsolate, | 48 resumeIsolate, |
69 | 49 |
70 ]; | 50 ]; |
71 | 51 |
72 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); | 52 main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain); |
OLD | NEW |