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

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

Issue 1319703002: Breaking Change: merge BoringSSL branch into master (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 | « tests/standalone/io/regress_21160_test.dart ('k') | tests/standalone/io/secure_bad_certificate_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/secure_bad_certificate_client.dart
diff --git a/tests/standalone/io/secure_bad_certificate_client.dart b/tests/standalone/io/secure_bad_certificate_client.dart
deleted file mode 100644
index c3922aeac3f1e15335a764a2d738707d7b17e25b..0000000000000000000000000000000000000000
--- a/tests/standalone/io/secure_bad_certificate_client.dart
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Client for secure_bad_certificate_test, that runs in a subprocess.
-// The test verifies that the client bad certificate callback works.
-
-import "dart:async";
-import "dart:io";
-
-class ExpectException implements Exception {
- ExpectException(this.message);
- String toString() => "ExpectException: $message";
- String message;
-}
-
-void expect(condition) {
- if (!condition) {
- throw new ExpectException('');
- }
-}
-
-const HOST_NAME = "localhost";
-
-void runClient(int port, result) {
- bool badCertificateCallback(X509Certificate certificate) {
- expect('CN=localhost' == certificate.subject);
- expect('CN=myauthority' == certificate.issuer);
- expect(result != 'exception'); // Throw exception if one is requested.
- if (result == 'true') result = true;
- if (result == 'false') result = false;
- return result;
- }
-
- SecureSocket.connect(HOST_NAME,
- port,
- onBadCertificate: badCertificateCallback)
- .then((SecureSocket socket) {
- expect(result);
- socket.close();
- },
- onError: (error) {
- expect(result != true);
- if (result == false) {
- expect(error is HandshakeException);
- } else if (result == 'exception') {
- expect(error is ExpectException);
- } else {
- expect(error is ArgumentError);
- }
- });
-}
-
-
-void main(List<String> args) {
- SecureSocket.initialize();
- runClient(int.parse(args[0]), args[1]);
-}
« no previous file with comments | « tests/standalone/io/regress_21160_test.dart ('k') | tests/standalone/io/secure_bad_certificate_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698