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

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

Issue 23886004: Update dart:io tests to use asyncStart/asyncEnd (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 3 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
« no previous file with comments | « tests/standalone/io/socket_invalid_arguments_test.dart ('k') | tests/standalone/io/socket_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
});
});
});
« no previous file with comments | « tests/standalone/io/socket_invalid_arguments_test.dart ('k') | tests/standalone/io/socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698