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

Side by Side Diff: tests/standalone/io/socket_ipv6_test.dart

Issue 14766003: Add v6Only named argument to ServerSocket and etc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« runtime/bin/socket_linux.cc ('K') | « sdk/lib/io/socket.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
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:io'; 5 import 'dart:io';
6 import 'dart:isolate'; 6 import 'dart:isolate';
7 7
8 const ANY = InternetAddressType.ANY; 8 const ANY = InternetAddressType.ANY;
9 9
10 void testIPv6toIPv6() { 10 void testIPv6toIPv6() {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 if (list.length < 0) throw "no addresse"; 81 if (list.length < 0) throw "no addresse";
82 for (var entry in list) { 82 for (var entry in list) {
83 if (entry.type != InternetAddressType.IP_V4) { 83 if (entry.type != InternetAddressType.IP_V4) {
84 throw "Wrong IP type"; 84 throw "Wrong IP type";
85 } 85 }
86 } 86 }
87 port.close(); 87 port.close();
88 }); 88 });
89 } 89 }
90 90
91 void testIPv4toIPv6_IPV6Only() {
92 InternetAddress.lookup("::0", type: ANY)
93 .then((serverAddr) {
94 ServerSocket.bind(serverAddr.first, 0, v6Only: true)
95 .then((server) {
96 server.listen((socket) {
97 throw "Unexpcted socket";
98 });
99 Socket.connect("127.0.0.1", server.port).catchError((error) {
100 server.close();
101 });
102 });
103 });
104 }
105
91 void main() { 106 void main() {
92 testIPv6toIPv6(); 107 testIPv6toIPv6();
93 testIPv4toIPv6(); 108 testIPv4toIPv6();
94 testIPv6toIPv4(); 109 testIPv6toIPv4();
95 testIPv4toIPv4(); 110 testIPv4toIPv4();
96 testIPv6Lookup(); 111 testIPv6Lookup();
97 testIPv4Lookup(); 112 testIPv4Lookup();
113
114 testIPv4toIPv6_IPV6Only();
98 } 115 }
OLDNEW
« runtime/bin/socket_linux.cc ('K') | « sdk/lib/io/socket.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698