| OLD | NEW |
| 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 // Tests socket exceptions. | 5 // Tests socket exceptions. |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 import "dart:async"; | 8 import "dart:async"; |
| 9 import "dart:isolate"; | 9 import "dart:isolate"; |
| 10 import "dart:io"; | 10 import "dart:io"; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 Socket.connect("127.0.0.1", server.port).then((client) { | 111 Socket.connect("127.0.0.1", server.port).then((client) { |
| 112 client.listen((data) {}, onDone: server.close); | 112 client.listen((data) {}, onDone: server.close); |
| 113 client.destroy(); | 113 client.destroy(); |
| 114 }); | 114 }); |
| 115 }); | 115 }); |
| 116 } | 116 } |
| 117 | 117 |
| 118 static void clientSocketAddDestroyNoErrorTest() { | 118 static void clientSocketAddDestroyNoErrorTest() { |
| 119 ServerSocket.bind("127.0.0.1", 0).then((server) { | 119 ServerSocket.bind("127.0.0.1", 0).then((server) { |
| 120 server.listen((socket) { | 120 server.listen((socket) { |
| 121 // Passive block data by not sobscribing to socket. | 121 // Passive block data by not subscribing to socket. |
| 122 }); | 122 }); |
| 123 Socket.connect("127.0.0.1", server.port).then((client) { | 123 Socket.connect("127.0.0.1", server.port).then((client) { |
| 124 client.listen((data) {}, onDone: server.close); | 124 client.listen((data) {}, onDone: server.close); |
| 125 client.add(new List.filled(1024 * 1024, 0)); | 125 client.add(new List.filled(1024 * 1024, 0)); |
| 126 client.destroy(); | 126 client.destroy(); |
| 127 }); | 127 }); |
| 128 }); | 128 }); |
| 129 } | 129 } |
| 130 | 130 |
| 131 static void clientSocketAddCloseNoErrorTest() { | 131 static void clientSocketAddCloseNoErrorTest() { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 clientSocketAddCloseErrorTest(); | 233 clientSocketAddCloseErrorTest(); |
| 234 clientSocketAddCloseResultErrorTest(); | 234 clientSocketAddCloseResultErrorTest(); |
| 235 unknownHostTest(); | 235 unknownHostTest(); |
| 236 } | 236 } |
| 237 } | 237 } |
| 238 | 238 |
| 239 main() { | 239 main() { |
| 240 SocketExceptionTest.testMain(); | 240 SocketExceptionTest.testMain(); |
| 241 } | 241 } |
| 242 | 242 |
| OLD | NEW |