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

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

Issue 22818006: Allow SocketException in https_bad_certificate_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/https_bad_certificate_client.dart
diff --git a/tests/standalone/io/https_bad_certificate_client.dart b/tests/standalone/io/https_bad_certificate_client.dart
index b1debdd7ef8f84ea1cdd2ce48421d33ec74ac941..da160ed0b6984af209d3954d3996c24b48c2cd36 100644
--- a/tests/standalone/io/https_bad_certificate_client.dart
+++ b/tests/standalone/io/https_bad_certificate_client.dart
@@ -40,8 +40,11 @@ Future runHttpClient(int port, result) {
var testFutures = [];
testFutures.add(client.getUrl(Uri.parse('https://$HOST_NAME:$port/$result'))
- .then((HttpClientRequest request) { expect(false); },
- onError: (e) { expect(e is HandshakeException); }));
+ .then((HttpClientRequest request) {
+ expect(false);
+ }, onError: (e) {
+ expect(e is HandshakeException || e is SocketException);
+ }));
client.badCertificateCallback = badCertificateCallback;
testFutures.add( client.getUrl(Uri.parse('https://$HOST_NAME:$port/$result'))
@@ -49,9 +52,11 @@ Future runHttpClient(int port, result) {
expect(result == 'true');
request.close().then((result) { });
}, onError: (e) {
- if (result == 'false') expect (e is HandshakeException);
- else if (result == 'exception') expect (e is ExpectException);
- else expect (e is ArgumentError);
+ if (result == 'false') expect (e is HandshakeException ||
+ e is SocketException);
+ else if (result == 'exception') expect (e is ExpectException ||
+ e is SocketException);
+ else expect (e is ArgumentError || e is SocketException);
}));
client.badCertificateCallback = null;
@@ -59,7 +64,7 @@ Future runHttpClient(int port, result) {
.then((HttpClientRequest request) {
expect(false);
}, onError: (e) {
- expect(e is HandshakeException);
+ expect(e is HandshakeException || e is SocketException);
}));
return Future.wait(testFutures);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698