Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Unified Diff: tests/standalone/io/process_stderr_test.dart

Issue 11091070: Change Process.start to return a future that completes with a (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Restructure to get rid of _onStart and _onError Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/io/process_start_exception_test.dart ('k') | tests/standalone/io/process_stdout_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/process_stderr_test.dart
diff --git a/tests/standalone/io/process_stderr_test.dart b/tests/standalone/io/process_stderr_test.dart
index 11141e32630506bec7d1a4cbc9e59d3585266054..49336e1cee708c93ce3bc55e66f0157b4e3d70dd 100644
--- a/tests/standalone/io/process_stderr_test.dart
+++ b/tests/standalone/io/process_stderr_test.dart
@@ -14,9 +14,12 @@
#source('process_test_util.dart');
-void test(Process process, int expectedExitCode) {
- // Wait for the process to start and then interact with it.
- process.onStart = () {
+void test(Future<Process> future, int expectedExitCode) {
+ future.then((process) {
+ process.onExit = (exitCode) {
+ Expect.equals(expectedExitCode, exitCode);
+ };
+
List<int> data = "ABCDEFGHI\n".charCodes();
final int dataSize = data.length;
@@ -50,11 +53,8 @@ void test(Process process, int expectedExitCode) {
output.write(data);
output.close();
input.onData = readData;
- };
- process.onExit = (exitCode) {
- Expect.equals(expectedExitCode, exitCode);
- };
+ });
}
main() {
« no previous file with comments | « tests/standalone/io/process_start_exception_test.dart ('k') | tests/standalone/io/process_stdout_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698