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 // VMOptions= | 5 // VMOptions= |
6 // VMOptions=--short_socket_read | 6 // VMOptions=--short_socket_read |
7 // VMOptions=--short_socket_write | 7 // VMOptions=--short_socket_write |
8 // VMOptions=--short_socket_read --short_socket_write | 8 // VMOptions=--short_socket_read --short_socket_write |
9 | 9 |
10 import "dart:async"; | 10 import "dart:async"; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 subscription.cancel(); | 203 subscription.cancel(); |
204 socket.close(); | 204 socket.close(); |
205 server.close(); | 205 server.close(); |
206 asyncEnd(); | 206 asyncEnd(); |
207 }, | 207 }, |
208 onDone: () { Expect.fail("Unexpected pipe completion"); }); | 208 onDone: () { Expect.fail("Unexpected pipe completion"); }); |
209 }); | 209 }); |
210 }); | 210 }); |
211 } | 211 } |
212 | 212 |
| 213 void testCloseWriteNoListen() { |
| 214 asyncStart(); |
| 215 ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) { |
| 216 server.listen( |
| 217 (client) { |
| 218 client.close(); |
| 219 }); |
| 220 Socket.connect("127.0.0.1", server.port).then((socket) { |
| 221 socket.close(); |
| 222 server.close(); |
| 223 asyncEnd(); |
| 224 }); |
| 225 }); |
| 226 } |
| 227 |
213 main() { | 228 main() { |
214 asyncStart(); | |
215 testArguments(); | 229 testArguments(); |
216 testSimpleBind(); | 230 testSimpleBind(); |
217 testInvalidBind(); | 231 testInvalidBind(); |
218 testConnectNoDestroy(); | 232 testConnectNoDestroy(); |
219 testConnectImmediateDestroy(); | 233 testConnectImmediateDestroy(); |
220 testConnectConsumerClose(); | 234 testConnectConsumerClose(); |
221 testConnectConsumerWriteClose(); | 235 testConnectConsumerWriteClose(); |
222 testConnectStreamClose(); | 236 testConnectStreamClose(); |
223 testConnectStreamDataClose(true); | 237 testConnectStreamDataClose(true); |
224 testConnectStreamDataClose(false); | 238 testConnectStreamDataClose(false); |
225 testConnectStreamDataCloseCancel(true); | 239 testConnectStreamDataCloseCancel(true); |
226 testConnectStreamDataCloseCancel(false); | 240 testConnectStreamDataCloseCancel(false); |
227 asyncEnd(); | 241 testCloseWriteNoListen(); |
228 } | 242 } |
OLD | NEW |