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

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

Issue 2709013004: Adjust test to run on no-IPv6 machines, update status file (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_bind_test.dart
diff --git a/tests/standalone/io/http_bind_test.dart b/tests/standalone/io/http_bind_test.dart
index a399b19efc279b2bcad2015687fa4d4859d8b51d..774471c91363775b8c2a110eeed815dd5f73bbea 100644
--- a/tests/standalone/io/http_bind_test.dart
+++ b/tests/standalone/io/http_bind_test.dart
@@ -59,8 +59,29 @@ testBindShared(String host, bool v6Only) async {
}
void main() {
- for (var host in ['127.0.0.1', '::1']) {
- testBindShared(host, false);
- testBindShared(host, true);
+ // Please don't change this to use await/async.
+ asyncStart();
+ supportsIPV6().then((ok) {
+ var addresses = ['127.0.0.1'];
+ if (ok) {
+ addresses.add('::1');
+ }
+ var futures = [];
+ for (var host in addresses) {
+ futures.add(testBindShared(host, false));
+ futures.add(testBindShared(host, true));
+ }
+ Future.wait(futures).then((_) => asyncEnd());
+ });
+}
+
+bool supportsIPV6() async {
+ try {
+ var socket = await ServerSocket.bind('::1', 0);
+ await socket.close();
+ return true;
+ } catch (e) {
+ print(e);
+ return false;
}
}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698