Index: tests/standalone/io/raw_secure_server_socket_test.dart |
diff --git a/tests/standalone/io/raw_secure_server_socket_test.dart b/tests/standalone/io/raw_secure_server_socket_test.dart |
index 873cfba471ec79c1cba003dc6b045721e5efb546..b512d6f569bf1779a4a17cae1c7603be17b1b07a 100644 |
--- a/tests/standalone/io/raw_secure_server_socket_test.dart |
+++ b/tests/standalone/io/raw_secure_server_socket_test.dart |
@@ -12,22 +12,21 @@ import "dart:async"; |
import "dart:io"; |
import "dart:isolate"; |
-const SERVER_ADDRESS = "127.0.0.1"; |
const HOST_NAME = "localhost"; |
const CERTIFICATE = "localhost_cert"; |
void testArguments() { |
Expect.throws(() => |
- RawSecureServerSocket.bind(SERVER_ADDRESS, 65536, 5, CERTIFICATE)); |
+ RawSecureServerSocket.bind(HOST_NAME, 65536, 5, CERTIFICATE)); |
Expect.throws(() => |
- RawSecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE)); |
+ RawSecureServerSocket.bind(HOST_NAME, -1, CERTIFICATE)); |
Expect.throws(() => |
- RawSecureServerSocket.bind(SERVER_ADDRESS, 0, -1, CERTIFICATE)); |
+ RawSecureServerSocket.bind(HOST_NAME, 0, -1, CERTIFICATE)); |
} |
void testSimpleBind() { |
ReceivePort port = new ReceivePort(); |
- RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((s) { |
+ RawSecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((s) { |
Expect.isTrue(s.port > 0); |
s.close(); |
port.close(); |
@@ -59,8 +58,8 @@ void testInvalidBind() { |
// Either an error or a successful bind is allowed. |
// Windows platforms allow multiple binding to the same socket, with |
// unpredictable results. |
- RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((s) { |
- RawSecureServerSocket.bind(SERVER_ADDRESS, |
+ RawSecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((s) { |
+ RawSecureServerSocket.bind(HOST_NAME, |
s.port, |
5, |
CERTIFICATE).then((t) { |
@@ -81,7 +80,7 @@ void testInvalidBind() { |
void testSimpleConnect(String certificate) { |
ReceivePort port = new ReceivePort(); |
- RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) { |
+ RawSecureServerSocket.bind(HOST_NAME, 0, 5, certificate).then((server) { |
var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port); |
server.listen((serverEnd) { |
clientEndFuture.then((clientEnd) { |
@@ -96,7 +95,7 @@ void testSimpleConnect(String certificate) { |
void testSimpleConnectFail(String certificate) { |
ReceivePort port = new ReceivePort(); |
- RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) { |
+ RawSecureServerSocket.bind(HOST_NAME, 0, 5, certificate).then((server) { |
var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port) |
.then((clientEnd) { |
Expect.fail("No client connection expected."); |
@@ -116,7 +115,7 @@ void testSimpleConnectFail(String certificate) { |
void testServerListenAfterConnect() { |
ReceivePort port = new ReceivePort(); |
- RawSecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) { |
+ RawSecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) { |
Expect.isTrue(server.port > 0); |
var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port); |
new Timer(const Duration(milliseconds: 500), () { |
@@ -441,9 +440,9 @@ void testSimpleReadWrite(bool listenSecure, |
if (listenSecure) { |
RawSecureServerSocket.bind( |
- SERVER_ADDRESS, 0, 5, CERTIFICATE).then(serverReady); |
+ HOST_NAME, 0, 5, CERTIFICATE).then(serverReady); |
} else { |
- RawServerSocket.bind(SERVER_ADDRESS, 0, 5).then(serverReady); |
+ RawServerSocket.bind(HOST_NAME, 0, 5).then(serverReady); |
} |
} |