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 658d5601326159c230d98fde3b5149af7a05d974..5b58e8273968d9e6c766aed05d1d5d44228a6afc 100644 |
--- a/tests/standalone/io/secure_socket_bad_certificate_test.dart |
+++ b/tests/standalone/io/secure_socket_bad_certificate_test.dart |
@@ -31,12 +31,10 @@ void main() { |
} |
Future testCertificateCallback({String host, bool acceptCertificate}) { |
- Expect.throws( |
- () { |
- var x = 7; |
- SecureSocket.connect(host, 443, onBadCertificate: x); |
- }, |
- (e) => e is ArgumentError || e is TypeError); |
+ var x = 7; |
+ SecureSocket.connect(host, 443, onBadCertificate: x) |
+ .catchError((e) {}, |
+ test: (e) => e is ArgumentError || e is TypeError); |
bool badCertificateCallback(X509Certificate certificate) { |
Expect.isTrue(certificate.subject.contains("O=Google Inc")); |