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

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

Issue 9568006: Missing handling of default arguments in socket stream readInto (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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/src/StreamPipeTest.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/TestingServer.dart
diff --git a/tests/standalone/src/TestingServer.dart b/tests/standalone/src/TestingServer.dart
index 643da7ef922553b0f44b1ee3d8a2634b06255412..74c008fb6271921f436af993365dc3d46115c21f 100644
--- a/tests/standalone/src/TestingServer.dart
+++ b/tests/standalone/src/TestingServer.dart
@@ -8,7 +8,7 @@ class TestingServer extends Isolate {
static final INIT = 0;
static final SHUTDOWN = -1;
- abstract void connectionHandler();
+ abstract void onConnection();
void main() {
void errorHandlerServer() {
@@ -19,7 +19,7 @@ class TestingServer extends Isolate {
if (message == INIT) {
_server = new ServerSocket(HOST, 0, 10);
Expect.equals(true, _server !== null);
- _server.onConnection = connectionHandler;
+ _server.onConnection = onConnection;
_server.onError = errorHandlerServer;
replyTo.send(_server.port, null);
} else if (message == SHUTDOWN) {
@@ -31,3 +31,34 @@ class TestingServer extends Isolate {
ServerSocket _server;
}
+
+class TestingServerTest {
+
+ TestingServerTest.start(TestingServer server)
+ : _receivePort = new ReceivePort(),
+ _sendPort = null {
+ server.spawn().then((SendPort port) {
+ _sendPort = port;
+ start();
+ });
+ }
+
+ abstract void run();
+
+ void start() {
+ _receivePort.receive((var message, SendPort replyTo) {
+ _port = message;
+ run();
+ });
+ _sendPort.send(TestingServer.INIT, _receivePort.toSendPort());
+ }
+
+ void shutdown() {
+ _sendPort.send(TestingServer.SHUTDOWN, _receivePort.toSendPort());
+ _receivePort.close();
+ }
+
+ int _port;
+ ReceivePort _receivePort;
+ SendPort _sendPort;
+}
« no previous file with comments | « tests/standalone/src/StreamPipeTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698