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

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

Issue 17589007: dart:io | Change names for SecureSocket exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bad upload to review tool. Created 7 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
Index: tests/standalone/io/raw_secure_server_socket_argument_test.dart
diff --git a/tests/standalone/io/raw_secure_server_socket_argument_test.dart b/tests/standalone/io/raw_secure_server_socket_argument_test.dart
index 6c78cbc7f6ffe889846f99213997934f47edbe05..ffaf38f0683a791a3585c80261e8edc2dad459d9 100644
--- a/tests/standalone/io/raw_secure_server_socket_argument_test.dart
+++ b/tests/standalone/io/raw_secure_server_socket_argument_test.dart
@@ -17,12 +17,39 @@ const CERTIFICATE = "localhost_cert";
void testArguments() {
+ bool isArgOrTypeError(e) => e is ArgumentError || e is TypeError;
Expect.throws(() =>
- RawSecureServerSocket.bind(SERVER_ADDRESS, 65536, 5, CERTIFICATE));
+ RawSecureServerSocket.bind(SERVER_ADDRESS, 65536, CERTIFICATE),
+ isArgOrTypeError);
Expect.throws(() =>
- RawSecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE));
- Expect.throws(() =>
- RawSecureServerSocket.bind(SERVER_ADDRESS, 0, -1, CERTIFICATE));
+ RawSecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureServerSocket.bind(SERVER_ADDRESS, 0,
+ CERTIFICATE, backlog: -1),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 3456,
+ sendClientCertificate: true,
+ certificateName: 12.3),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, null),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, -1),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 345656),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 'hest'),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(null, 0),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
+ certificateName: 77),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
+ sendClientCertificate: 'fisk'),
+ isArgOrTypeError);
+ Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
+ onBadCertificate: 'hund'),
+ isArgOrTypeError);
}

Powered by Google App Engine
This is Rietveld 408576698