| Index: tests/standalone/io/socket_ipv6_test.dart
|
| diff --git a/tests/standalone/io/socket_ipv6_test.dart b/tests/standalone/io/socket_ipv6_test.dart
|
| index d483b8eb2656d3f714f1a6695bd98e1c9f835293..bded728d20319557ebc4ec702987378f0740aa90 100644
|
| --- a/tests/standalone/io/socket_ipv6_test.dart
|
| +++ b/tests/standalone/io/socket_ipv6_test.dart
|
| @@ -3,17 +3,20 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| import 'dart:io';
|
| -import 'dart:isolate';
|
| +
|
| +import "package:async_helper/async_helper.dart";
|
|
|
| const ANY = InternetAddressType.ANY;
|
|
|
| void testIPv6toIPv6() {
|
| + asyncStart();
|
| InternetAddress.lookup("::0", type: ANY).then((serverAddr) {
|
| InternetAddress.lookup("::1", type: ANY).then((clientAddr) {
|
| ServerSocket.bind(serverAddr.first, 0).then((server) {
|
| server.listen((socket) {
|
| socket.destroy();
|
| server.close();
|
| + asyncEnd();
|
| });
|
| Socket.connect(clientAddr.first, server.port).then((socket) {
|
| socket.destroy();
|
| @@ -24,11 +27,13 @@ void testIPv6toIPv6() {
|
| }
|
|
|
| void testIPv4toIPv6() {
|
| + asyncStart();
|
| InternetAddress.lookup("::0", type: ANY).then((serverAddr) {
|
| ServerSocket.bind(serverAddr.first, 0).then((server) {
|
| server.listen((socket) {
|
| socket.destroy();
|
| server.close();
|
| + asyncEnd();
|
| });
|
| Socket.connect("127.0.0.1", server.port).then((socket) {
|
| socket.destroy();
|
| @@ -38,6 +43,7 @@ void testIPv4toIPv6() {
|
| }
|
|
|
| void testIPv6toIPv4() {
|
| + asyncStart();
|
| InternetAddress.lookup("::1", type: ANY).then((clientAddr) {
|
| ServerSocket.bind("127.0.0.1", 0).then((server) {
|
| server.listen((socket) {
|
| @@ -45,16 +51,19 @@ void testIPv6toIPv4() {
|
| });
|
| Socket.connect(clientAddr.first, server.port).catchError((e) {
|
| server.close();
|
| + asyncEnd();
|
| });
|
| });
|
| });
|
| }
|
|
|
| void testIPv4toIPv4() {
|
| + asyncStart();
|
| ServerSocket.bind("127.0.0.1", 0).then((server) {
|
| server.listen((socket) {
|
| socket.destroy();
|
| server.close();
|
| + asyncEnd();
|
| });
|
| Socket.connect("127.0.0.1", server.port).then((socket) {
|
| socket.destroy();
|
| @@ -63,7 +72,7 @@ void testIPv4toIPv4() {
|
| }
|
|
|
| void testIPv6Lookup() {
|
| - var port = new ReceivePort();
|
| + asyncStart();
|
| InternetAddress.lookup("::0", type: ANY).then((list) {
|
| if (list.length < 0) throw "no address";
|
| for (var entry in list) {
|
| @@ -71,12 +80,12 @@ void testIPv6Lookup() {
|
| throw "Wrong IP type";
|
| }
|
| }
|
| - port.close();
|
| + asyncEnd();
|
| });
|
| }
|
|
|
| void testIPv4Lookup() {
|
| - var port = new ReceivePort();
|
| + asyncStart();
|
| InternetAddress.lookup("127.0.0.1").then((list) {
|
| if (list.length < 0) throw "no addresse";
|
| for (var entry in list) {
|
| @@ -84,11 +93,12 @@ void testIPv4Lookup() {
|
| throw "Wrong IP type";
|
| }
|
| }
|
| - port.close();
|
| + asyncEnd();
|
| });
|
| }
|
|
|
| void testIPv4toIPv6_IPV6Only() {
|
| + asyncStart();
|
| InternetAddress.lookup("::0", type: ANY)
|
| .then((serverAddr) {
|
| ServerSocket.bind(serverAddr.first, 0, v6Only: true)
|
| @@ -98,6 +108,7 @@ void testIPv4toIPv6_IPV6Only() {
|
| });
|
| Socket.connect("127.0.0.1", server.port).catchError((error) {
|
| server.close();
|
| + asyncEnd();
|
| });
|
| });
|
| });
|
|
|