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

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

Issue 8273035: Add short read/write testing of Socket and Process tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 | « no previous file | tests/standalone/src/EchoServerStreamTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/EchoServerStreamReadUntilTest.dart
diff --git a/tests/standalone/src/EchoServerStreamReadUntilTest.dart b/tests/standalone/src/EchoServerStreamReadUntilTest.dart
index e8df2282668230572adde6a9bc793a730bbfa616..33a035aec62ecaa92d4c35d720559599bcbafa19 100644
--- a/tests/standalone/src/EchoServerStreamReadUntilTest.dart
+++ b/tests/standalone/src/EchoServerStreamReadUntilTest.dart
@@ -3,6 +3,11 @@
// BSD-style license that can be found in the LICENSE file.
//
// Echo server test program to test socket stream read until functionality.
+//
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
main() {
EchoServerStreamReadUntilTest.testMain();
@@ -146,12 +151,17 @@ class EchoServer extends Isolate {
for (int i = 0; i < MSGSIZE - 1; i++) {
Expect.equals(EchoServerGame.FIRSTCHAR + i, buffer[i]);
}
- outputStream.write(buffer, 0, buffer.length, null);
- inputStream.readUntil(PATTERN2, dataReceived);
+ void next() {
+ inputStream.readUntil(PATTERN2, dataReceived);
+ inputStream.readUntil(PATTERN2, dataReceived);
+ }
+ bool done = outputStream.write(buffer, 0, buffer.length, next);
+ if (done) {
+ next();
+ }
} else {
Expect.equals(1, buffer.length);
outputStream.write(buffer, 0, buffer.length, null);
- inputStream.readUntil(PATTERN2, dataReceived);
}
}
« no previous file with comments | « no previous file | tests/standalone/src/EchoServerStreamTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698