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

Unified Diff: tests/standalone/io/echo_server_stream_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_stream_test.dart
diff --git a/tests/standalone/io/echo_server_stream_test.dart b/tests/standalone/io/echo_server_stream_test.dart
index 775795c7bb8adc6353e80b95d1b1918a2103c4eb..4581126b074573cdd2a02929b7c4aaeff2ec53fb 100644
--- a/tests/standalone/io/echo_server_stream_test.dart
+++ b/tests/standalone/io/echo_server_stream_test.dart
@@ -27,10 +27,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() {
@@ -135,6 +133,14 @@ class EchoServerGame {
}
+void startEchoServer() {
+ var server = new EchoServer();
+ port.receive((message, SendPort replyTo) {
+ server.dispatch(message, replyTo);
+ });
+}
+
+
class EchoServer extends TestingServer {
static final int MSGSIZE = EchoServerGame.MSGSIZE;

Powered by Google App Engine
This is Rietveld 408576698