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

Side by Side Diff: tests/standalone/io/raw_socket_test.dart

Issue 985533003: Make Socket address and port getters available after the socket is closed (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 }); 442 });
443 } 443 }
444 444
445 void testClosedError() { 445 void testClosedError() {
446 asyncStart(); 446 asyncStart();
447 RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) { 447 RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
448 server.listen((socket) { socket.close(); }); 448 server.listen((socket) { socket.close(); });
449 RawSocket.connect("127.0.0.1", server.port).then((socket) { 449 RawSocket.connect("127.0.0.1", server.port).then((socket) {
450 server.close(); 450 server.close();
451 socket.close(); 451 socket.close();
452 Expect.throws(() => socket.port, (e) => e is SocketException);
453 Expect.throws(() => socket.remotePort, (e) => e is SocketException); 452 Expect.throws(() => socket.remotePort, (e) => e is SocketException);
454 Expect.throws(() => socket.address, (e) => e is SocketException);
455 Expect.throws(() => socket.remoteAddress, (e) => e is SocketException); 453 Expect.throws(() => socket.remoteAddress, (e) => e is SocketException);
456 asyncEnd(); 454 asyncEnd();
457 }); 455 });
458 }); 456 });
459 } 457 }
460 458
461 main() { 459 main() {
462 asyncStart(); 460 asyncStart();
463 testArguments(); 461 testArguments();
464 testSimpleBind(); 462 testSimpleBind();
465 testCloseOneEnd("client"); 463 testCloseOneEnd("client");
466 testCloseOneEnd("server"); 464 testCloseOneEnd("server");
467 testInvalidBind(); 465 testInvalidBind();
468 testSimpleConnect(); 466 testSimpleConnect();
469 testServerListenAfterConnect(); 467 testServerListenAfterConnect();
470 testSimpleReadWrite(dropReads: false); 468 testSimpleReadWrite(dropReads: false);
471 testSimpleReadWrite(dropReads: true); 469 testSimpleReadWrite(dropReads: true);
472 testPauseServerSocket(); 470 testPauseServerSocket();
473 testPauseSocket(); 471 testPauseSocket();
474 testSocketZone(); 472 testSocketZone();
475 testSocketZoneError(); 473 testSocketZoneError();
476 testClosedError(); 474 testClosedError();
477 asyncEnd(); 475 asyncEnd();
478 } 476 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698