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

Unified Diff: tests/standalone/src/SocketCloseTest.dart

Issue 8726031: Change handling of accepting socket connections (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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/src/EchoServerTest.dart ('k') | tests/standalone/src/SocketManyConnectionsTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/SocketCloseTest.dart
diff --git a/tests/standalone/src/SocketCloseTest.dart b/tests/standalone/src/SocketCloseTest.dart
index 29c34b28ec0b9d0cc7ac87a99139e6d63f80d227..d329d331956c2a75e734c298a937e3fac0c80afe 100644
--- a/tests/standalone/src/SocketCloseTest.dart
+++ b/tests/standalone/src/SocketCloseTest.dart
@@ -209,8 +209,7 @@ class SocketCloseServer extends Isolate {
void main() {
- void connectionHandler() {
- Socket _client;
+ void connectionHandler(Socket connection) {
void dataHandler() {
_dataEvents++;
@@ -220,30 +219,30 @@ class SocketCloseServer extends Isolate {
break;
case 1:
List<int> b = new List<int>(100);
- _client.readList(b, 0, 100);
+ connection.readList(b, 0, 100);
break;
case 2:
List<int> b = new List<int>(100);
- _client.readList(b, 0, 100);
- _client.close();
+ connection.readList(b, 0, 100);
+ connection.close();
break;
case 3:
List<int> b = new List<int>(100);
- _client.readList(b, 0, 100);
- _client.writeList("Hello".charCodes(), 0, 5);
- _client.close();
+ connection.readList(b, 0, 100);
+ connection.writeList("Hello".charCodes(), 0, 5);
+ connection.close();
break;
case 4:
List<int> b = new List<int>(100);
- _client.readList(b, 0, 100);
- _client.writeList("Hello".charCodes(), 0, 5);
+ connection.readList(b, 0, 100);
+ connection.writeList("Hello".charCodes(), 0, 5);
break;
case 5:
case 6:
List<int> b = new List<int>(100);
- _client.readList(b, 0, 100);
- _client.writeList("Hello".charCodes(), 0, 5);
- _client.close(true);
+ connection.readList(b, 0, 100);
+ connection.writeList("Hello".charCodes(), 0, 5);
+ connection.close(true);
break;
default:
Expect.fail("Unknown test mode");
@@ -252,19 +251,18 @@ class SocketCloseServer extends Isolate {
void closeHandler() {
_closeEvents++;
- _client.close();
+ connection.close();
}
void errorHandler() {
Expect.fail("Socket error");
}
- _client = _server.accept();
_iterations++;
- _client.dataHandler = dataHandler;
- _client.closeHandler = closeHandler;
- _client.errorHandler = errorHandler;
+ connection.dataHandler = dataHandler;
+ connection.closeHandler = closeHandler;
+ connection.errorHandler = errorHandler;
}
void errorHandlerServer() {
« no previous file with comments | « tests/standalone/src/EchoServerTest.dart ('k') | tests/standalone/src/SocketManyConnectionsTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698