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

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

Issue 2950413002: Added timeout parameter to RawSecureSocket and SecureSocket connect methods. Also updated CHANGELOG… (Closed)
Patch Set: Created 3 years, 6 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 | « sdk/lib/io/secure_socket.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/secure_socket_test.dart
diff --git a/tests/standalone/io/secure_socket_test.dart b/tests/standalone/io/secure_socket_test.dart
index c8ddccd29ecb62c1babec18307a4d6eb12247406..442fa192cdc52bfb00018d33bb9ccf1584f8c0ea 100644
--- a/tests/standalone/io/secure_socket_test.dart
+++ b/tests/standalone/io/secure_socket_test.dart
@@ -80,9 +80,22 @@ Future test(String certType, String password) {
return completer.future;
}
+void testConnectTimeout() {
+ asyncStart();
+ Duration timeout = new Duration(milliseconds: 20);
+ SecureSocket.connect("8.8.8.7", 80, timeout: timeout).then((socket) {
+ Expect.fail("Unexpected connection made.");
+ asyncEnd();
+ }).catchError((e) {
+ Expect.isTrue(e is SocketException);
+ asyncEnd();
+ });
+}
+
main() async {
asyncStart();
await test('pem', 'dartdart');
await test('p12', 'dartdart');
+ testConnectTimeout();
asyncEnd();
}
« no previous file with comments | « sdk/lib/io/secure_socket.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698