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

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

Issue 755883007: Handle IPv6 addresses for HTTP client requests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_ipv6_test.dart
diff --git a/tests/standalone/io/http_ipv6_test.dart b/tests/standalone/io/http_ipv6_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..99560f02be5041c1267d7f48d48aa8dbb6e7b927
--- /dev/null
+++ b/tests/standalone/io/http_ipv6_test.dart
@@ -0,0 +1,44 @@
+// (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+
+import "package:expect/expect.dart";
+import "dart:async";
+import "dart:isolate";
+import "dart:io";
+
+// Client makes a HTTP 1.0 request without connection keep alive. The
+// server sets a content length but still needs to close the
+// connection as there is no keep alive.
+void testHttpIPv6() {
+ HttpServer.bind("::", 0).then((server) {
+ server.listen((HttpRequest request) {
+ Expect.equals(request.headers["host"][0], "[::]:${server.port}");
+ Expect.equals(request.requestedUri.host, "::");
+ request.response.close();
+ });
+
+ var client = new HttpClient();
+ var url = Uri.parse('http://[::]:${server.port}/xxx');
+ Expect.equals(url.host, '::');
+ client.openUrl('GET', url)
+ .then((request) => request.close())
+ .then((response) {
+ Expect.equals(response.statusCode, HttpStatus.OK);
+ }).whenComplete(() {
+ server.close();
+ client.close();
+ });
+ });
+}
+
+
+
+void main() {
+ testHttpIPv6();
+}
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698