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

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

Issue 25716002: Fix secure_socket_bad_data_test to allow early failure. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix test instead of status file. Created 7 years, 2 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/secure_socket_bad_data_test.dart
diff --git a/tests/standalone/io/secure_socket_bad_data_test.dart b/tests/standalone/io/secure_socket_bad_data_test.dart
index 0b6f8135d154bbbde4e83b30356f0181122b40f1..de4b3f7befd81b19c0c3a14d7e0883cd246167d2 100644
--- a/tests/standalone/io/secure_socket_bad_data_test.dart
+++ b/tests/standalone/io/secure_socket_bad_data_test.dart
@@ -142,18 +142,22 @@ Future<List> connectClient(int port, bool hostnameInConnect) =>
Future test(bool hostnameInConnect) {
return RawServerSocket.bind(HOST_NAME, 0)
- .then((server) {
- server.listen((client) {
- RawSecureSocket.secureServer(client, CERTIFICATE)
- .then((secureClient) {
- Expect.throws(() => client.add([0]));
- return runServer(secureClient);
- })
- .then((_) => server.close());
+ .then((server) {
+ server.listen((client) {
+ RawSecureSocket.secureServer(client, CERTIFICATE)
+ .then((secureClient) {
+ Expect.throws(() => client.add([0]));
+ return runServer(secureClient);
+ },
+ onError: (e) {
+ Expect.isTrue(e is HandshakeException);
+ Expect.isTrue(e.toString().contains(
+ 'received a record with an incorrect Message Authentication'));
+ })
+ .whenComplete(server.close);
+ });
+ return connectClient(server.port, hostnameInConnect).then(runClient);
});
-
- return connectClient(server.port, hostnameInConnect).then(runClient);
- });
}
« 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