| 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 expect(frames.length, greaterThanOrEqualTo(1)); | 268 expect(frames.length, greaterThanOrEqualTo(1)); |
| 269 | 269 |
| 270 Frame top = frames[0]; | 270 Frame top = frames[0]; |
| 271 Script script = await top.location.script.load(); | 271 Script script = await top.location.script.load(); |
| 272 int actualLine = script.tokenToLine(top.location.tokenPos); | 272 int actualLine = script.tokenToLine(top.location.tokenPos); |
| 273 if (actualLine != line) { | 273 if (actualLine != line) { |
| 274 var sb = new StringBuffer(); | 274 var sb = new StringBuffer(); |
| 275 sb.write("Expected to be at line $line but actually at line $actualLine"); | 275 sb.write("Expected to be at line $line but actually at line $actualLine"); |
| 276 sb.write("\nFull stack trace:\n"); | 276 sb.write("\nFull stack trace:\n"); |
| 277 for (Frame f in stack['frames']) { | 277 for (Frame f in stack['frames']) { |
| 278 sb.write(" $f\n"); | 278 sb.write(" $f [${await f.location.getLine()}]\n"); |
| 279 } | 279 } |
| 280 throw sb.toString(); | 280 throw sb.toString(); |
| 281 } | 281 } |
| 282 }; | 282 }; |
| 283 } | 283 } |
| 284 | 284 |
| 285 | 285 |
| 286 Future<Isolate> resumeIsolate(Isolate isolate) { | 286 Future<Isolate> resumeIsolate(Isolate isolate) { |
| 287 Completer completer = new Completer(); | 287 Completer completer = new Completer(); |
| 288 isolate.vm.getEventStream(VM.kDebugStream).then((stream) { | 288 isolate.vm.getEventStream(VM.kDebugStream).then((stream) { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 }, onError: (e, st) { | 398 }, onError: (e, st) { |
| 399 process.requestExit(); | 399 process.requestExit(); |
| 400 if (!_isWebSocketDisconnect(e)) { | 400 if (!_isWebSocketDisconnect(e)) { |
| 401 print('Unexpected exception in service tests: $e $st'); | 401 print('Unexpected exception in service tests: $e $st'); |
| 402 throw e; | 402 throw e; |
| 403 } | 403 } |
| 404 }); | 404 }); |
| 405 }); | 405 }); |
| 406 } | 406 } |
| 407 } | 407 } |
| OLD | NEW |