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

Unified Diff: tests/standalone/src/ProcessStdoutTest.dart

Issue 8413034: New OutputStream interface (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from ager@ Created 9 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/src/ProcessStderrTest.dart ('k') | tests/standalone/src/SocketExceptionTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/ProcessStdoutTest.dart
diff --git a/tests/standalone/src/ProcessStdoutTest.dart b/tests/standalone/src/ProcessStdoutTest.dart
index 7177144e5db14bbd5c57a20739135d598731a795..644ea4f0ba47fab8e2aee2e14ea56f842f28ca83 100644
--- a/tests/standalone/src/ProcessStdoutTest.dart
+++ b/tests/standalone/src/ProcessStdoutTest.dart
@@ -29,30 +29,25 @@ class ProcessStdoutTest {
int received = 0;
- void dataWritten() {
- void readData() {
- List<int> buffer = input.read();
- for (int i = 0; i < buffer.length; i++) {
- Expect.equals(data[received + i], buffer[i]);
- }
- received += buffer.length;
- if (received == BUFFERSIZE) {
- process.close();
- }
+ void readData() {
+ List<int> buffer = input.read();
+ for (int i = 0; i < buffer.length; i++) {
+ Expect.equals(data[received + i], buffer[i]);
}
-
- void streamClosed() {
- Expect.equals(BUFFERSIZE, received);
+ received += buffer.length;
+ if (received == BUFFERSIZE) {
+ process.close();
}
-
- input.dataHandler = readData;
- input.closeHandler = streamClosed;
}
- bool written = output.write(data, 0, BUFFERSIZE, dataWritten);
- if (written) {
- dataWritten();
+ void streamClosed() {
+ Expect.equals(BUFFERSIZE, received);
}
+
+ output.write(data);
+ output.end();
+ input.dataHandler = readData;
+ input.closeHandler = streamClosed;
}
static void testMain() {
« no previous file with comments | « tests/standalone/src/ProcessStderrTest.dart ('k') | tests/standalone/src/SocketExceptionTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698