| Index: tests/standalone/io/secure_client_raw_server_test.dart
|
| diff --git a/tests/standalone/io/secure_client_raw_server_test.dart b/tests/standalone/io/secure_client_raw_server_test.dart
|
| index 9d40baf72981d7a74ca01a7b01ed94c0a2595bd9..e380f753d0494c74ccdb5aed1277549a097d146a 100644
|
| --- a/tests/standalone/io/secure_client_raw_server_test.dart
|
| +++ b/tests/standalone/io/secure_client_raw_server_test.dart
|
| @@ -7,16 +7,16 @@
|
| // VMOptions=--short_socket_write
|
| // VMOptions=--short_socket_read --short_socket_write
|
|
|
| -import "package:expect/expect.dart";
|
| -import "package:path/path.dart";
|
| import "dart:async";
|
| import "dart:io";
|
| -import "dart:isolate";
|
|
|
| -const HOST_NAME = "localhost";
|
| +import "package:async_helper/async_helper.dart";
|
| +import "package:expect/expect.dart";
|
| +
|
| +InternetAddress HOST;
|
| const CERTIFICATE = "localhost_cert";
|
| Future<RawSecureServerSocket> startEchoServer() {
|
| - return RawSecureServerSocket.bind(HOST_NAME,
|
| + return RawSecureServerSocket.bind(HOST,
|
| 0,
|
| CERTIFICATE).then((server) {
|
| server.listen((RawSecureSocket client) {
|
| @@ -60,7 +60,7 @@ Future<RawSecureServerSocket> startEchoServer() {
|
| Future testClient(server) {
|
| Completer success = new Completer();
|
| List<String> chunks = <String>[];
|
| - SecureSocket.connect(HOST_NAME, server.port).then((socket) {
|
| + SecureSocket.connect(HOST, server.port).then((socket) {
|
| socket.write("Hello server.");
|
| socket.close();
|
| socket.listen(
|
| @@ -78,13 +78,13 @@ Future testClient(server) {
|
| }
|
|
|
| void main() {
|
| + asyncStart();
|
| String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
|
| SecureSocket.initialize(database: certificateDatabase,
|
| password: 'dartdart');
|
| -
|
| - startEchoServer()
|
| + InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first)
|
| + .then((_) => startEchoServer())
|
| .then(testClient)
|
| - .then((server) {
|
| - server.close();
|
| - });
|
| + .then((server) => server.close())
|
| + .then((_) => asyncEnd());
|
| }
|
|
|