| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library test_helper; | 5 library test_helper; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 import 'package:observatory/service_io.dart'; | 10 import 'package:observatory/service_io.dart'; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 202 |
| 203 IsolateTest stoppedAtLine(int line) { | 203 IsolateTest stoppedAtLine(int line) { |
| 204 return (Isolate isolate) async { | 204 return (Isolate isolate) async { |
| 205 print("Checking we are at line $line"); | 205 print("Checking we are at line $line"); |
| 206 | 206 |
| 207 ServiceMap stack = await isolate.getStack(); | 207 ServiceMap stack = await isolate.getStack(); |
| 208 expect(stack.type, equals('Stack')); | 208 expect(stack.type, equals('Stack')); |
| 209 expect(stack['frames'].length, greaterThanOrEqualTo(1)); | 209 expect(stack['frames'].length, greaterThanOrEqualTo(1)); |
| 210 | 210 |
| 211 Frame top = stack['frames'][0]; | 211 Frame top = stack['frames'][0]; |
| 212 print("We are at $top"); |
| 212 Script script = await top.location.script.load(); | 213 Script script = await top.location.script.load(); |
| 213 expect(script.tokenToLine(top.location.tokenPos), equals(line)); | 214 expect(script.tokenToLine(top.location.tokenPos), equals(line)); |
| 214 }; | 215 }; |
| 215 } | 216 } |
| 216 | 217 |
| 217 | 218 |
| 218 Future<Isolate> resumeIsolate(Isolate isolate) { | 219 Future<Isolate> resumeIsolate(Isolate isolate) { |
| 219 Completer completer = new Completer(); | 220 Completer completer = new Completer(); |
| 220 isolate.vm.getEventStream(VM.kDebugStream).then((stream) { | 221 isolate.vm.getEventStream(VM.kDebugStream).then((stream) { |
| 221 var subscription; | 222 var subscription; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 }, onError: (e, st) { | 313 }, onError: (e, st) { |
| 313 process.requestExit(); | 314 process.requestExit(); |
| 314 if (!_isWebSocketDisconnect(e)) { | 315 if (!_isWebSocketDisconnect(e)) { |
| 315 print('Unexpected exception in service tests: $e $st'); | 316 print('Unexpected exception in service tests: $e $st'); |
| 316 throw e; | 317 throw e; |
| 317 } | 318 } |
| 318 }); | 319 }); |
| 319 }); | 320 }); |
| 320 } | 321 } |
| 321 } | 322 } |
| OLD | NEW |