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

Side by Side 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 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // VMOptions=
6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write
9
10 import "package:expect/expect.dart";
11 import "dart:async";
12 import "dart:isolate";
13 import "dart:io";
14
15 // Client makes a HTTP 1.0 request without connection keep alive. The
16 // server sets a content length but still needs to close the
17 // connection as there is no keep alive.
18 void testHttpIPv6() {
19 HttpServer.bind("::", 0).then((server) {
20 server.listen((HttpRequest request) {
21 Expect.equals(request.headers["host"][0], "[::]:${server.port}");
22 Expect.equals(request.requestedUri.host, "::");
23 request.response.close();
24 });
25
26 var client = new HttpClient();
27 var url = Uri.parse('http://[::]:${server.port}/xxx');
28 Expect.equals(url.host, '::');
29 client.openUrl('GET', url)
30 .then((request) => request.close())
31 .then((response) {
32 Expect.equals(response.statusCode, HttpStatus.OK);
33 }).whenComplete(() {
34 server.close();
35 client.close();
36 });
37 });
38 }
39
40
41
42 void main() {
43 testHttpIPv6();
44 }
OLDNEW
« 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