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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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_std_io_script2.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 b84d81c73d017f1e631feacc459f96c82eedc7a1..858bb9a7388948c314ba6756ae529290c3473220 100644
--- a/tests/standalone/io/process_stderr_test.dart
+++ b/tests/standalone/io/process_stderr_test.dart
@@ -17,20 +17,18 @@ import "process_test_util.dart";
void test(Future<Process> future, int expectedExitCode) {
future.then((process) {
- process.onExit = (exitCode) {
+ process.exitCode.then((exitCode) {
Expect.equals(expectedExitCode, exitCode);
- };
+ });
List<int> data = "ABCDEFGHI\n".charCodes;
final int dataSize = data.length;
- InputStream err = process.stderr;
-
int received = 0;
List<int> buffer = [];
- void readData() {
- buffer.addAll(err.read());
+ void readData(data) {
+ buffer.addAll(data);
for (int i = received;
i < min(data.length, buffer.length) - 1;
i++) {
@@ -47,10 +45,10 @@ void test(Future<Process> future, int expectedExitCode) {
}
}
- process.stdout.onData = process.stdout.read;
- process.stdin.write(data);
+ process.stdout.listen((_) {});
+ process.stdin.add(data);
process.stdin.close();
- err.onData = readData;
+ process.stderr.listen(readData);
});
}
« no previous file with comments | « tests/standalone/io/process_std_io_script2.dart ('k') | tests/standalone/io/process_stdout_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698