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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 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
Index: tests/standalone/io/socket_info_test.dart
diff --git a/tests/standalone/io/socket_info_test.dart b/tests/standalone/io/socket_info_test.dart
index e35eab6b8242ce6c47ddb721bb5b70bb26e30000..f3b675f8e0288d8a771f8e815fb9ad8436e9c971 100644
--- a/tests/standalone/io/socket_info_test.dart
+++ b/tests/standalone/io/socket_info_test.dart
@@ -1,23 +1,24 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// 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:io";
void testHostAndPort() {
- ServerSocket server = new ServerSocket("127.0.0.1", 0, 5);
+ ServerSocket.bind().then((server) {
- Socket clientSocket = new Socket("127.0.0.1", server.port);
+ Socket.connect("127.0.0.1", server.port).then((clientSocket) {
+ server.listen((socket) {
+ Expect.equals(socket.port, server.port);
+ Expect.equals(clientSocket.port, socket.remotePort);
+ Expect.equals(clientSocket.remotePort, socket.port);
+ Expect.equals(socket.remoteHost, "127.0.0.1");
+ Expect.equals(clientSocket.remoteHost, "127.0.0.1");
- server.onConnection = (Socket socket) {
- Expect.equals(socket.port, server.port);
- Expect.equals(clientSocket.port, socket.remotePort);
- Expect.equals(clientSocket.remotePort, socket.port);
- Expect.equals(socket.remoteHost, "127.0.0.1");
- Expect.equals(clientSocket.remoteHost, "127.0.0.1");
-
- server.close();
- };
+ server.close();
+ });
+ });
+ });
}
void main() {
« no previous file with comments | « tests/standalone/io/socket_exception_test.dart ('k') | tests/standalone/io/socket_invalid_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698