Index: tests/standalone/io/secure_socket_bad_certificate_test.dart |
diff --git a/tests/standalone/io/secure_socket_bad_certificate_test.dart b/tests/standalone/io/secure_socket_bad_certificate_test.dart |
index 85b1cd3c714262369ec0c73ec70ac973244c4654..658d5601326159c230d98fde3b5149af7a05d974 100644 |
--- a/tests/standalone/io/secure_socket_bad_certificate_test.dart |
+++ b/tests/standalone/io/secure_socket_bad_certificate_test.dart |
@@ -31,12 +31,12 @@ void main() { |
} |
Future testCertificateCallback({String host, bool acceptCertificate}) { |
- try { |
- var x = 7; |
- SecureSocket.connect(host, 443, onBadCertificate: x) |
- .catchError((e) {}, test: (e) => e is ArgumentError); |
- } on TypeError catch (e) { |
- } |
+ Expect.throws( |
+ () { |
+ var x = 7; |
+ SecureSocket.connect(host, 443, onBadCertificate: x); |
+ }, |
+ (e) => e is ArgumentError || e is TypeError); |
bool badCertificateCallback(X509Certificate certificate) { |
Expect.isTrue(certificate.subject.contains("O=Google Inc")); |