Index: tests/standalone/io/secure_server_socket_test.dart |
diff --git a/tests/standalone/io/secure_server_socket_test.dart b/tests/standalone/io/secure_server_socket_test.dart |
index bf1bc05a0bb15aba16820edba4fc820774b29a51..11e0fe8c95e91430704c96d13d0f051c5052a7ee 100644 |
--- a/tests/standalone/io/secure_server_socket_test.dart |
+++ b/tests/standalone/io/secure_server_socket_test.dart |
@@ -12,12 +12,13 @@ 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 testSimpleBind() { |
ReceivePort port = new ReceivePort(); |
- SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((s) { |
+ SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((s) { |
Expect.isTrue(s.port > 0); |
s.close(); |
port.close(); |
@@ -49,8 +50,8 @@ void testInvalidBind() { |
// Either an error or a successful bind is allowed. |
// Windows platforms allow multiple binding to the same socket, with |
// unpredictable results. |
- SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((s) { |
- SecureServerSocket.bind(HOST_NAME, |
+ SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((s) { |
+ SecureServerSocket.bind(SERVER_ADDRESS, |
s.port, |
5, |
CERTIFICATE).then((t) { |
@@ -70,7 +71,7 @@ void testInvalidBind() { |
void testSimpleConnect(String certificate) { |
ReceivePort port = new ReceivePort(); |
- SecureServerSocket.bind(HOST_NAME, 0, 5, certificate).then((server) { |
+ SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) { |
var clientEndFuture = SecureSocket.connect(HOST_NAME, server.port); |
server.listen((serverEnd) { |
clientEndFuture.then((clientEnd) { |
@@ -85,7 +86,7 @@ void testSimpleConnect(String certificate) { |
void testSimpleConnectFail(String certificate) { |
ReceivePort port = new ReceivePort(); |
- SecureServerSocket.bind(HOST_NAME, 0, 5, certificate).then((server) { |
+ SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, certificate).then((server) { |
var clientEndFuture = SecureSocket.connect(HOST_NAME, server.port) |
.then((clientEnd) { |
Expect.fail("No client connection expected."); |
@@ -105,7 +106,7 @@ void testSimpleConnectFail(String certificate) { |
void testServerListenAfterConnect() { |
ReceivePort port = new ReceivePort(); |
- SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) { |
+ SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) { |
Expect.isTrue(server.port > 0); |
var clientEndFuture = SecureSocket.connect(HOST_NAME, server.port); |
new Timer(const Duration(milliseconds: 500), () { |
@@ -146,7 +147,7 @@ void testSimpleReadWrite() { |
} |
} |
- SecureServerSocket.bind(HOST_NAME, 0, 5, CERTIFICATE).then((server) { |
+ SecureServerSocket.bind(SERVER_ADDRESS, 0, 5, CERTIFICATE).then((server) { |
server.listen((client) { |
int bytesRead = 0; |
int bytesWritten = 0; |