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

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

Issue 665823007: Several bugfixes in dart:io's handing of sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added two spaces as requested Created 6 years, 2 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 | « dart/runtime/bin/socket_patch.dart ('k') | dart/tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/standalone/io/server_socket_reference_issue21383_and_issue21384_test.dart
diff --git a/dart/tests/standalone/io/server_socket_reference_issue21383_and_issue21384_test.dart b/dart/tests/standalone/io/server_socket_reference_issue21383_and_issue21384_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..95e0363ca7489f38225efdc255241f1c1b0856cf
--- /dev/null
+++ b/dart/tests/standalone/io/server_socket_reference_issue21383_and_issue21384_test.dart
@@ -0,0 +1,73 @@
+// 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.
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:async_helper/async_helper.dart';
+
+
+testBothListen() {
+ asyncStart();
+ ServerSocket.bind('127.0.0.1', 0).then((mainServer) {
+ mainServer.reference.create().then((refServer) {
+ refServer.listen((_) {});
+ mainServer.listen((_) {});
+ Timer.run(() {
+ mainServer.close();
+ refServer.close();
+ asyncEnd();
+ });
+ });
+ });
+}
+
+testRefServerListen() {
+ asyncStart();
+ ServerSocket.bind('127.0.0.1', 0).then((mainServer) {
+ mainServer.reference.create().then((refServer) {
+ refServer.listen((_) {});
+ Timer.run(() {
+ mainServer.close();
+ refServer.close();
+ asyncEnd();
+ });
+ });
+ });
+}
+
+testMainServerListen() {
+ asyncStart();
+ ServerSocket.bind('127.0.0.1', 0).then((mainServer) {
+ mainServer.reference.create().then((refServer) {
+ mainServer.listen((_) {});
+ Timer.run(() {
+ mainServer.close();
+ refServer.close();
+ asyncEnd();
+ });
+ });
+ });
+}
+
+testNoneListen() {
+ asyncStart();
+ ServerSocket.bind('127.0.0.1', 0).then((mainServer) {
+ mainServer.reference.create().then((refServer) {
+ Timer.run(() {
+ mainServer.close();
+ refServer.close();
+ asyncEnd();
+ });
+ });
+ });
+}
+
+main() {
+ testNoneListen();
+ testMainServerListen();
+ testRefServerListen();
+ testBothListen();
+}
+
« no previous file with comments | « dart/runtime/bin/socket_patch.dart ('k') | dart/tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698