| 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 scheduled_process; | 5 library scheduled_process; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 | 9 |
| 10 import 'scheduled_test.dart'; | 10 import 'scheduled_test.dart'; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 /// debug information if an error occurs. | 190 /// debug information if an error occurs. |
| 191 void _scheduleExceptionCleanup() { | 191 void _scheduleExceptionCleanup() { |
| 192 currentSchedule.onException.schedule(() { | 192 currentSchedule.onException.schedule(() { |
| 193 _stdoutSubscription.cancel(); | 193 _stdoutSubscription.cancel(); |
| 194 _stderrSubscription.cancel(); | 194 _stderrSubscription.cancel(); |
| 195 | 195 |
| 196 if (!_process.hasValue) return; | 196 if (!_process.hasValue) return; |
| 197 | 197 |
| 198 var killedPrematurely = false; | 198 var killedPrematurely = false; |
| 199 if (!_exitCode.hasValue) { | 199 if (!_exitCode.hasValue) { |
| 200 var killedPrematurely = true; | 200 killedPrematurely = true; |
| 201 _endExpected = true; | 201 _endExpected = true; |
| 202 _process.value.kill(); | 202 _process.value.kill(); |
| 203 // Ensure that the onException queue waits for the process to actually | 203 // Ensure that the onException queue waits for the process to actually |
| 204 // exit after being killed. | 204 // exit after being killed. |
| 205 wrapFuture(_process.value.exitCode); | 205 wrapFuture(_process.value.exitCode); |
| 206 } | 206 } |
| 207 | 207 |
| 208 return Future.wait([ | 208 return Future.wait([ |
| 209 _stdoutLog.toList(), | 209 _stdoutLog.toList(), |
| 210 _stderrLog.toList() | 210 _stderrLog.toList() |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 schedule(() { | 297 schedule(() { |
| 298 _endExpected = true; | 298 _endExpected = true; |
| 299 return _exitCode.then((exitCode) { | 299 return _exitCode.then((exitCode) { |
| 300 if (expectedExitCode != null) { | 300 if (expectedExitCode != null) { |
| 301 expect(exitCode, equals(expectedExitCode)); | 301 expect(exitCode, equals(expectedExitCode)); |
| 302 } | 302 } |
| 303 }); | 303 }); |
| 304 }, "waiting for process '$description' to exit"); | 304 }, "waiting for process '$description' to exit"); |
| 305 } | 305 } |
| 306 } | 306 } |
| OLD | NEW |