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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 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/io/string_stream_test.dart ('k') | tests/standalone/io/url_encoding_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/testing_server.dart
diff --git a/tests/standalone/io/testing_server.dart b/tests/standalone/io/testing_server.dart
index e37a989d3f6bd27fd0efa12d8d1d534823ba8bb2..79ab136a7a764cdd47e3b0ad10d19667e5afabd2 100644
--- a/tests/standalone/io/testing_server.dart
+++ b/tests/standalone/io/testing_server.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -12,17 +12,19 @@ abstract class TestingServer {
void onConnection(Socket connection); // Abstract.
- void errorHandlerServer(Exception e) {
+ void errorHandlerServer(e) {
Expect.fail("Server socket error $e");
}
void dispatch(message, SendPort replyTo) {
if (message == INIT) {
- _server = new ServerSocket(HOST, 0, 10);
- Expect.equals(true, _server != null);
- _server.onConnection = onConnection;
- _server.onError = errorHandlerServer;
- replyTo.send(_server.port, null);
+ ServerSocket.bind(HOST, 0, 10).then((server) {
+ _server = server;
+ _server.listen(
+ onConnection,
+ onError: errorHandlerServer);
+ replyTo.send(_server.port, null);
+ });
} else if (message == SHUTDOWN) {
_server.close();
port.close();
« no previous file with comments | « tests/standalone/io/string_stream_test.dart ('k') | tests/standalone/io/url_encoding_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698