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

Unified Diff: tests/standalone/io/process_stdout_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: 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
Index: tests/standalone/io/process_stdout_test.dart
diff --git a/tests/standalone/io/process_stdout_test.dart b/tests/standalone/io/process_stdout_test.dart
index 3ade8fe1816566ef117756655843417b688e1843..614d16161c49b2147f446eda861048827e489266 100644
--- a/tests/standalone/io/process_stdout_test.dart
+++ b/tests/standalone/io/process_stdout_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,7 @@ void test(Process process, int expectedExitCode) {
output.write(data);
output.close();
input.onData = readData;
- };
-
- process.onExit = (exitCode) {
- Expect.equals(expectedExitCode, exitCode);
- };
+ });
}
main() {

Powered by Google App Engine
This is Rietveld 408576698