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

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

Issue 2205913003: Better error-message when bind fails. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Add android support. Created 4 years, 4 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
« no previous file with comments | « runtime/bin/socket_win.cc ('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 5
6 import "dart:async"; 6 import "dart:async";
7 import "dart:io"; 7 import "dart:io";
8 8
9 import "package:async_helper/async_helper.dart"; 9 import "package:async_helper/async_helper.dart";
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 25 matching lines...) Expand all
36 await throws(() => connectFunction('127.0.0.1', 36 await throws(() => connectFunction('127.0.0.1',
37 server.port, 37 server.port,
38 sourceAddress: sourceAddress), 38 sourceAddress: sourceAddress),
39 (e) => e is ArgumentError); 39 (e) => e is ArgumentError);
40 } 40 }
41 // Unsupported local address. 41 // Unsupported local address.
42 for (sourceAddress in ['8.8.8.8', new InternetAddress('8.8.8.8')]) { 42 for (sourceAddress in ['8.8.8.8', new InternetAddress('8.8.8.8')]) {
43 await throws(() => connectFunction('127.0.0.1', 43 await throws(() => connectFunction('127.0.0.1',
44 server.port, 44 server.port,
45 sourceAddress: sourceAddress), 45 sourceAddress: sourceAddress),
46 (e) => e is SocketException); 46 (e) => e is SocketException &&
47 e.address == new InternetAddress('8.8.8.8'));
47 } 48 }
48 // Address family mismatch. 49 // Address family mismatch.
49 for (sourceAddress in ['::1', InternetAddress.LOOPBACK_IP_V6]) { 50 for (sourceAddress in ['::1', InternetAddress.LOOPBACK_IP_V6]) {
50 await throws(() => connectFunction('127.0.0.1', 51 await throws(() => connectFunction('127.0.0.1',
51 server.port, 52 server.port,
52 sourceAddress: sourceAddress), 53 sourceAddress: sourceAddress),
53 (e) => e is SocketException); 54 (e) => e is SocketException);
54 } 55 }
55 asyncEnd(); 56 asyncEnd();
56 server.close(); 57 server.close();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 InternetAddress.ANY_IP_V4, false, Socket.connect, (s) => s.destroy()); 139 InternetAddress.ANY_IP_V4, false, Socket.connect, (s) => s.destroy());
139 testConnect( 140 testConnect(
140 InternetAddress.ANY_IP_V6, false, RawSocket.connect, (s) => s.close()); 141 InternetAddress.ANY_IP_V6, false, RawSocket.connect, (s) => s.close());
141 testConnect( 142 testConnect(
142 InternetAddress.ANY_IP_V6, false, Socket.connect, (s) => s.destroy()); 143 InternetAddress.ANY_IP_V6, false, Socket.connect, (s) => s.destroy());
143 testConnect( 144 testConnect(
144 InternetAddress.ANY_IP_V6, true, RawSocket.connect, (s) => s.close()); 145 InternetAddress.ANY_IP_V6, true, RawSocket.connect, (s) => s.close());
145 testConnect( 146 testConnect(
146 InternetAddress.ANY_IP_V6, true, Socket.connect, (s) => s.destroy()); 147 InternetAddress.ANY_IP_V6, true, Socket.connect, (s) => s.destroy());
147 } 148 }
OLDNEW
« no previous file with comments | « runtime/bin/socket_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698