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

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

Issue 12381013: dart:io | Split raw_server_socket_cancel test off from raw_socket_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/raw_server_socket_cancel_test.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/raw_socket_test.dart
diff --git a/tests/standalone/io/raw_socket_test.dart b/tests/standalone/io/raw_socket_test.dart
index 0f89d2f646a12ff99415d205060524609dbe1e00..01e8e71993a9b362ada888a81adcbae955463953 100644
--- a/tests/standalone/io/raw_socket_test.dart
+++ b/tests/standalone/io/raw_socket_test.dart
@@ -263,61 +263,7 @@ testPauseServerSocket() {
});
}
-testCancelResubscribeServerSocket() {
- const int socketCount = 10;
- var acceptCount = 0;
- var doneCount = 0;
- var closeCount = 0;
- var errorCount = 0;
-
- ReceivePort port = new ReceivePort();
-
- RawServerSocket.bind().then((server) {
- Expect.isTrue(server.port > 0);
-
- void checkDone() {
- if (doneCount == socketCount &&
- closeCount + errorCount == socketCount) {
- port.close();
- }
- }
-
- // Subscribe the server socket. Then cancel subscription and
- // subscribe again.
- var subscription;
- subscription = server.listen((client) {
- if (++acceptCount == socketCount / 2) {
- subscription.cancel();
- Timer.run(() {
- subscription = server.listen((_) {
- // Close on cancel, so no more events.
- Expect.fail("Event after closed through cancel");
- });
- });
- }
- // Close the client socket.
- client.close();
- });
-
- // Connect a number of sockets.
- for (int i = 0; i < socketCount; i++) {
- RawSocket.connect("127.0.0.1", server.port).then((socket) {
- socket.writeEventsEnabled = false;
- var subscription;
- subscription = socket.listen((event) {
- Expect.equals(RawSocketEvent.READ_CLOSED, event);
- socket.close();
- closeCount++;
- checkDone();
- },
- onDone: () { doneCount++; checkDone(); },
- onError: (e) { errorCount++; checkDone(); });
- });
- }
- });
-}
-
-testPauseSocket() {
+void testPauseSocket() {
const messageSize = 1000;
const loopCount = 10;
Completer connected = new Completer();
@@ -407,6 +353,5 @@ main() {
testServerListenAfterConnect();
testSimpleReadWrite();
testPauseServerSocket();
- testCancelResubscribeServerSocket();
testPauseSocket();
}
« no previous file with comments | « tests/standalone/io/raw_server_socket_cancel_test.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698