| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 }); | 59 }); |
| 60 | 60 |
| 61 // Add the breakpoint. | 61 // Add the breakpoint. |
| 62 var script = isolate.rootLib.scripts[0]; | 62 var script = isolate.rootLib.scripts[0]; |
| 63 return isolate.addBreakpoint(script, 18).then((result) { | 63 return isolate.addBreakpoint(script, 18).then((result) { |
| 64 expect(result is Breakpoint, isTrue); | 64 expect(result is Breakpoint, isTrue); |
| 65 Breakpoint bpt = result; | 65 Breakpoint bpt = result; |
| 66 expect(bpt.type, equals('Breakpoint')); | 66 expect(bpt.type, equals('Breakpoint')); |
| 67 expect(bpt.script.id, equals(script.id)); | 67 expect(bpt.script.id, equals(script.id)); |
| 68 expect(bpt.tokenPos, equals(67)); | 68 expect(bpt.tokenPos, equals(66)); |
| 69 expect(isolate.breakpoints.length, equals(1)); | 69 expect(isolate.breakpoints.length, equals(1)); |
| 70 return completer.future; // Wait for breakpoint events. | 70 return completer.future; // Wait for breakpoint events. |
| 71 }); | 71 }); |
| 72 }); | 72 }); |
| 73 }, | 73 }, |
| 74 | 74 |
| 75 // Get the stack trace | 75 // Get the stack trace |
| 76 (Isolate isolate) { | 76 (Isolate isolate) { |
| 77 return isolate.getStack().then((ServiceMap stack) { | 77 return isolate.getStack().then((ServiceMap stack) { |
| 78 expect(stack.type, equals('Stack')); | 78 expect(stack.type, equals('Stack')); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 ServiceFunction function = isolate.rootLib.functions.firstWhere( | 158 ServiceFunction function = isolate.rootLib.functions.firstWhere( |
| 159 (f) => f.name == 'helper'); | 159 (f) => f.name == 'helper'); |
| 160 expect(function, isNotNull); | 160 expect(function, isNotNull); |
| 161 | 161 |
| 162 // Add the breakpoint at function entry | 162 // Add the breakpoint at function entry |
| 163 return isolate.addBreakpointAtEntry(function).then((result) { | 163 return isolate.addBreakpointAtEntry(function).then((result) { |
| 164 expect(result is Breakpoint, isTrue); | 164 expect(result is Breakpoint, isTrue); |
| 165 Breakpoint bpt = result; | 165 Breakpoint bpt = result; |
| 166 expect(bpt.type, equals('Breakpoint')); | 166 expect(bpt.type, equals('Breakpoint')); |
| 167 expect(bpt.script.name, equals('debugging_test.dart')); | 167 expect(bpt.script.name, equals('debugging_test.dart')); |
| 168 expect(bpt.tokenPos, equals(29)); | 168 expect(bpt.tokenPos, equals(28)); |
| 169 expect(isolate.breakpoints.length, equals(1)); | 169 expect(isolate.breakpoints.length, equals(1)); |
| 170 return completer.future; // Wait for breakpoint events. | 170 return completer.future; // Wait for breakpoint events. |
| 171 }); | 171 }); |
| 172 }, | 172 }, |
| 173 | 173 |
| 174 ]; | 174 ]; |
| 175 | 175 |
| 176 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); | 176 main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction); |
| OLD | NEW |