| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'test_helper.dart'; | 6 import 'test_helper.dart'; |
| 7 import 'service_test_common.dart'; | 7 import 'service_test_common.dart'; |
| 8 import 'package:observatory/service_io.dart'; | 8 import 'package:observatory/service_io.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 vmService = new VMServiceClient(uri); | 24 vmService = new VMServiceClient(uri); |
| 25 await new Future.microtask(() => throw new TimeoutException("here")); | 25 await new Future.microtask(() => throw new TimeoutException("here")); |
| 26 } on dynamic { | 26 } on dynamic { |
| 27 vmService.close(); | 27 vmService.close(); |
| 28 rethrow; // LINE_A | 28 rethrow; // LINE_A |
| 29 } | 29 } |
| 30 }); | 30 }); |
| 31 } | 31 } |
| 32 | 32 |
| 33 test_code() async { // LINE_B | 33 test_code() async { // LINE_B |
| 34 await collect(); | 34 try { |
| 35 await collect(); |
| 36 } on TimeoutException { |
| 37 print("ok"); |
| 38 } |
| 35 } | 39 } |
| 36 | 40 |
| 37 Future<Isolate> stepThroughProgram(Isolate isolate) async { | 41 Future<Isolate> stepThroughProgram(Isolate isolate) async { |
| 38 Completer completer = new Completer(); | 42 Completer completer = new Completer(); |
| 39 int pauseEventsSeen = 0; | 43 int pauseEventsSeen = 0; |
| 40 | 44 |
| 41 await subscribeToStream(isolate.vm, VM.kDebugStream, | 45 await subscribeToStream(isolate.vm, VM.kDebugStream, |
| 42 (ServiceEvent event) async { | 46 (ServiceEvent event) async { |
| 43 if (event.kind == ServiceEvent.kPauseBreakpoint) { | 47 if (event.kind == ServiceEvent.kPauseBreakpoint) { |
| 44 // We are paused: Step further. | 48 // We are paused: Step further. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 hasStoppedAtBreakpoint, | 66 hasStoppedAtBreakpoint, |
| 63 setBreakpointAtLine(LINE_A), | 67 setBreakpointAtLine(LINE_A), |
| 64 resumeIsolate, | 68 resumeIsolate, |
| 65 hasStoppedAtBreakpoint, | 69 hasStoppedAtBreakpoint, |
| 66 stepOut, | 70 stepOut, |
| 67 stoppedAtLine(LINE_B), | 71 stoppedAtLine(LINE_B), |
| 68 resumeIsolate]; | 72 resumeIsolate]; |
| 69 | 73 |
| 70 main(args) => runIsolateTestsSynchronous(args, tests, | 74 main(args) => runIsolateTestsSynchronous(args, tests, |
| 71 testeeConcurrent: test_code, pause_on_start: true, pause_on_exit: false); | 75 testeeConcurrent: test_code, pause_on_start: true, pause_on_exit: false); |
| OLD | NEW |