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

Side by Side Diff: tests/standalone/src/SocketManyConnectionsTest.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, 9 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
« no previous file with comments | « tests/standalone/src/Regress-1925.dart ('k') | tests/standalone/src/StreamPipeTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Test creating a large number of socket connections. 5 // Test creating a large number of socket connections.
6 6
7 #library("SocketManyConnectionsTest");
8 #import("dart:io"); 7 #import("dart:io");
9 #import("dart:isolate"); 8 #import("dart:isolate");
10 #source("TestingServer.dart"); 9 #source("TestingServer.dart");
11 10
12 final CONNECTIONS = 200; 11 final CONNECTIONS = 200;
13 12
14 class SocketManyConnectionsTest { 13 class SocketManyConnectionsTest {
15 14
16 SocketManyConnectionsTest.start() 15 SocketManyConnectionsTest.start()
17 : _receivePort = new ReceivePort(), 16 : _receivePort = new ReceivePort(),
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 60
62 int _port; 61 int _port;
63 ReceivePort _receivePort; 62 ReceivePort _receivePort;
64 SendPort _sendPort; 63 SendPort _sendPort;
65 List<Socket> _sockets; 64 List<Socket> _sockets;
66 int _connections; 65 int _connections;
67 } 66 }
68 67
69 class TestServer extends TestingServer { 68 class TestServer extends TestingServer {
70 69
71 void connectionHandler(Socket connection) { 70 void onConnection(Socket connection) {
72 Socket _client; 71 Socket _client;
73 72
74 void closeHandler() { 73 void closeHandler() {
75 connection.close(); 74 connection.close();
76 } 75 }
77 76
78 void errorHandler() { 77 void errorHandler() {
79 print("Socket error"); 78 print("Socket error");
80 connection.close(); 79 connection.close();
81 } 80 }
82 81
83 _connections++; 82 _connections++;
84 connection.onClosed = closeHandler; 83 connection.onClosed = closeHandler;
85 connection.onError = errorHandler; 84 connection.onError = errorHandler;
86 } 85 }
87 86
88 int _connections = 0; 87 int _connections = 0;
89 } 88 }
90 89
91 main() { 90 main() {
92 SocketManyConnectionsTest test = new SocketManyConnectionsTest.start(); 91 SocketManyConnectionsTest test = new SocketManyConnectionsTest.start();
93 } 92 }
OLDNEW
« no previous file with comments | « tests/standalone/src/Regress-1925.dart ('k') | tests/standalone/src/StreamPipeTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698