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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 await isolate.resume(); | 368 await isolate.resume(); |
369 return completer.future; | 369 return completer.future; |
370 } | 370 } |
371 | 371 |
372 IsolateTest resumeIsolateAndAwaitEvent(stream, onEvent) { | 372 IsolateTest resumeIsolateAndAwaitEvent(stream, onEvent) { |
373 return (Isolate isolate) async => | 373 return (Isolate isolate) async => |
374 resumeAndAwaitEvent(isolate, stream, onEvent); | 374 resumeAndAwaitEvent(isolate, stream, onEvent); |
375 } | 375 } |
376 | 376 |
377 | 377 |
| 378 Future<Isolate> stepOver(Isolate isolate) async { |
| 379 await isolate.stepOver(); |
| 380 return hasStoppedAtBreakpoint(isolate); |
| 381 } |
| 382 |
378 Future<Class> getClassFromRootLib(Isolate isolate, String className) async { | 383 Future<Class> getClassFromRootLib(Isolate isolate, String className) async { |
379 Library rootLib = await isolate.rootLibrary.load(); | 384 Library rootLib = await isolate.rootLibrary.load(); |
380 for (var i = 0; i < rootLib.classes.length; i++) { | 385 for (var i = 0; i < rootLib.classes.length; i++) { |
381 Class cls = rootLib.classes[i]; | 386 Class cls = rootLib.classes[i]; |
382 if (cls.name == className) { | 387 if (cls.name == className) { |
383 return cls; | 388 return cls; |
384 } | 389 } |
385 } | 390 } |
386 return null; | 391 return null; |
387 } | 392 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 }, onError: (e, st) { | 456 }, onError: (e, st) { |
452 process.requestExit(); | 457 process.requestExit(); |
453 if (!_isWebSocketDisconnect(e)) { | 458 if (!_isWebSocketDisconnect(e)) { |
454 print('Unexpected exception in service tests: $e $st'); | 459 print('Unexpected exception in service tests: $e $st'); |
455 throw e; | 460 throw e; |
456 } | 461 } |
457 }); | 462 }); |
458 }); | 463 }); |
459 } | 464 } |
460 } | 465 } |
OLD | NEW |