| 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 | 4 |
| 5 import 'package:observatory/service_io.dart'; | 5 import 'package:observatory/service_io.dart'; |
| 6 import 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 import 'test_helper.dart'; | 7 import 'test_helper.dart'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 | 9 |
| 10 void helper(i) { | 10 void helper(i) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 }); | 62 }); |
| 63 | 63 |
| 64 // Add the breakpoint. | 64 // Add the breakpoint. |
| 65 var script = isolate.rootLib.scripts[0]; | 65 var script = isolate.rootLib.scripts[0]; |
| 66 return isolate.addBreakpoint(script, 18).then((result) { | 66 return isolate.addBreakpoint(script, 18).then((result) { |
| 67 expect(result is Breakpoint, isTrue); | 67 expect(result is Breakpoint, isTrue); |
| 68 Breakpoint bpt = result; | 68 Breakpoint bpt = result; |
| 69 expect(bpt.type, equals('Breakpoint')); | 69 expect(bpt.type, equals('Breakpoint')); |
| 70 expect(bpt.script.id, equals(script.id)); | 70 expect(bpt.script.id, equals(script.id)); |
| 71 expect(bpt.tokenPos, equals(67)); | 71 expect(bpt.tokenPos, equals(66)); |
| 72 expect(isolate.breakpoints.length, equals(1)); | 72 expect(isolate.breakpoints.length, equals(1)); |
| 73 return completer.future; // Wait for breakpoint events. | 73 return completer.future; // Wait for breakpoint events. |
| 74 }); | 74 }); |
| 75 }); | 75 }); |
| 76 }, | 76 }, |
| 77 | 77 |
| 78 // Get the stack trace | 78 // Get the stack trace |
| 79 (Isolate isolate) { | 79 (Isolate isolate) { |
| 80 return isolate.getStack().then((ServiceMap stack) { | 80 return isolate.getStack().then((ServiceMap stack) { |
| 81 expect(stack.type, equals('Stack')); | 81 expect(stack.type, equals('Stack')); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 ServiceFunction function = isolate.rootLib.functions.firstWhere( | 146 ServiceFunction function = isolate.rootLib.functions.firstWhere( |
| 147 (f) => f.name == 'helper'); | 147 (f) => f.name == 'helper'); |
| 148 expect(function, isNotNull); | 148 expect(function, isNotNull); |
| 149 | 149 |
| 150 // Add the breakpoint at function entry | 150 // Add the breakpoint at function entry |
| 151 return isolate.addBreakpointAtEntry(function).then((result) { | 151 return isolate.addBreakpointAtEntry(function).then((result) { |
| 152 expect(result is Breakpoint, isTrue); | 152 expect(result is Breakpoint, isTrue); |
| 153 Breakpoint bpt = result; | 153 Breakpoint bpt = result; |
| 154 expect(bpt.type, equals('Breakpoint')); | 154 expect(bpt.type, equals('Breakpoint')); |
| 155 expect(bpt.script.name, equals('debugging_test.dart')); | 155 expect(bpt.script.name, equals('debugging_test.dart')); |
| 156 expect(bpt.tokenPos, equals(29)); | 156 expect(bpt.tokenPos, equals(28)); |
| 157 expect(isolate.breakpoints.length, equals(1)); | 157 expect(isolate.breakpoints.length, equals(1)); |
| 158 return completer.future; // Wait for breakpoint events. | 158 return completer.future; // Wait for breakpoint events. |
| 159 }); | 159 }); |
| 160 }, | 160 }, |
| 161 | 161 |
| 162 ]; | 162 ]; |
| 163 | 163 |
| 164 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); | 164 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); |
| OLD | NEW |