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

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

Issue 10837070: Remove old isolate API and update all code in the repository to use (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix namespace comment. Created 8 years, 5 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/echo_server_test.dart
diff --git a/tests/standalone/io/echo_server_test.dart b/tests/standalone/io/echo_server_test.dart
index d197369799fe25787be5eef312237b0f3bdbe700..6d5a7cff2adf86c69a3a307427ebf6ddb5e78fcb 100644
--- a/tests/standalone/io/echo_server_test.dart
+++ b/tests/standalone/io/echo_server_test.dart
@@ -35,10 +35,8 @@ class EchoServerGame {
for (int i = 0; i < MSGSIZE; i++) {
_buffer[i] = FIRSTCHAR + i;
}
- new EchoServer().spawn().then((SendPort port) {
- _sendPort = port;
- start();
- });
+ _sendPort = spawnFunction(startEchoServer);
+ start();
}
void sendData() {
@@ -129,6 +127,14 @@ class EchoServerGame {
int _messages;
}
+
+void startEchoServer() {
+ var server = new EchoServer();
+ port.receive((message, replyTo) {
+ server.dispatch(message, replyTo);
+ });
+}
+
class EchoServer extends TestingServer {
static final msgSize = EchoServerGame.MSGSIZE;

Powered by Google App Engine
This is Rietveld 408576698