| 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_test.scheduled_process; | 5 library scheduled_test.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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 ]).then((results) { | 144 ]).then((results) { |
| 145 executable = results[0]; | 145 executable = results[0]; |
| 146 arguments = results[1]; | 146 arguments = results[1]; |
| 147 workingDirectory = results[2]; | 147 workingDirectory = results[2]; |
| 148 environment = results[3]; | 148 environment = results[3]; |
| 149 _updateDescription(executable, arguments); | 149 _updateDescription(executable, arguments); |
| 150 return Process.start(executable, | 150 return Process.start(executable, |
| 151 arguments, | 151 arguments, |
| 152 workingDirectory: workingDirectory, | 152 workingDirectory: workingDirectory, |
| 153 environment: environment).then((process) { | 153 environment: environment).then((process) { |
| 154 // TODO(nweiz): enable this when issue 9020 is fixed. | 154 process.stdin.encoding = Encoding.UTF_8; |
| 155 // process.stdin.encoding = Encoding.UTF_8; | |
| 156 return process; | 155 return process; |
| 157 }); | 156 }); |
| 158 }); | 157 }); |
| 159 }, "starting process '$description'")); | 158 }, "starting process '$description'")); |
| 160 } | 159 } |
| 161 | 160 |
| 162 /// Listens for [_process] to exit and passes the exit code to | 161 /// Listens for [_process] to exit and passes the exit code to |
| 163 /// [exitCodeCompleter]. If the process completes earlier than expected, an | 162 /// [exitCodeCompleter]. If the process completes earlier than expected, an |
| 164 /// exception will be signaled to the schedule. | 163 /// exception will be signaled to the schedule. |
| 165 void _handleExit(Completer exitCodeCompleter) { | 164 void _handleExit(Completer exitCodeCompleter) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 schedule(() { | 344 schedule(() { |
| 346 _endExpected = true; | 345 _endExpected = true; |
| 347 return _exitCode.then((exitCode) { | 346 return _exitCode.then((exitCode) { |
| 348 if (expectedExitCode != null) { | 347 if (expectedExitCode != null) { |
| 349 expect(exitCode, equals(expectedExitCode)); | 348 expect(exitCode, equals(expectedExitCode)); |
| 350 } | 349 } |
| 351 }); | 350 }); |
| 352 }, "waiting for process '$description' to exit"); | 351 }, "waiting for process '$description' to exit"); |
| 353 } | 352 } |
| 354 } | 353 } |
| OLD | NEW |