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

Side by Side Diff: tests/standalone/io/testing_server.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of ServerTest; 5 part of ServerTest;
6 6
7 abstract class TestingServer { 7 abstract class TestingServer {
8 8
9 static const HOST = "127.0.0.1"; 9 static const HOST = "127.0.0.1";
10 static const INIT = 0; 10 static const INIT = 0;
11 static const SHUTDOWN = -1; 11 static const SHUTDOWN = -1;
12 12
13 void onConnection(Socket connection); // Abstract. 13 void onConnection(Socket connection); // Abstract.
14 14
15 void errorHandlerServer(e) { 15 void errorHandlerServer(e) {
16 Expect.fail("Server socket error $e"); 16 String msg = "Server socket error $e";
17 var trace = getAttachedStackTrace(e);
18 if (trace != null) msg += "\nStackTrace: $trace";
19 Expect.fail(msg);
17 } 20 }
18 21
19 void dispatch(message, SendPort replyTo) { 22 void dispatch(message, SendPort replyTo) {
20 if (message == INIT) { 23 if (message == INIT) {
21 ServerSocket.bind(HOST, 0, 10).then((server) { 24 ServerSocket.bind(HOST, 0, 10).then((server) {
22 _server = server; 25 _server = server;
23 _server.listen( 26 _server.listen(
24 onConnection, 27 onConnection,
25 onError: errorHandlerServer); 28 onError: errorHandlerServer);
26 replyTo.send(_server.port, null); 29 replyTo.send(_server.port, null);
(...skipping 27 matching lines...) Expand all
54 57
55 void shutdown() { 58 void shutdown() {
56 _sendPort.send(TestingServer.SHUTDOWN, _receivePort.toSendPort()); 59 _sendPort.send(TestingServer.SHUTDOWN, _receivePort.toSendPort());
57 _receivePort.close(); 60 _receivePort.close();
58 } 61 }
59 62
60 int _port; 63 int _port;
61 ReceivePort _receivePort; 64 ReceivePort _receivePort;
62 SendPort _sendPort; 65 SendPort _sendPort;
63 } 66 }
OLDNEW
« no previous file with comments | « tests/standalone/io/string_transformer_test.dart ('k') | tests/standalone/io/web_socket_protocol_processor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698