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

Side by Side Diff: tests/standalone/io/secure_unauthorized_client.dart

Issue 1665433002: Adds SecurityContext.setTrustedCertificatesBytes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Client for secure_bad_certificate_test, that runs in a subprocess. 5 // Client for secure_bad_certificate_test, that runs in a subprocess.
6 // The test verifies that the client bad certificate callback works. 6 // The test verifies that the client bad certificate callback works.
7 7
8 import "dart:async"; 8 import "dart:async";
9 import "dart:io"; 9 import "dart:io";
10 10
11 String localFile(path) => Platform.script.resolve(path).toFilePath(); 11 String localFile(path) => Platform.script.resolve(path).toFilePath();
12 12
13 SecurityContext clientContext = new SecurityContext() 13 SecurityContext clientContext = new SecurityContext()
14 ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem')); 14 ..setTrustedCertificatesSync(localFile('certificates/trusted_certs.pem'));
15 15
16 class ExpectException implements Exception { 16 class ExpectException implements Exception {
17 ExpectException(this.message); 17 ExpectException(this.message);
18 String toString() => "ExpectException: $message"; 18 String toString() => "ExpectException: $message";
19 String message; 19 String message;
20 } 20 }
21 21
22 void expect(condition) { 22 void expect(condition) {
23 if (!condition) { 23 if (!condition) {
24 throw new ExpectException(''); 24 throw new ExpectException('');
(...skipping 14 matching lines...) Expand all
39 })); 39 }));
40 } 40 }
41 return Future.wait(testFutures); 41 return Future.wait(testFutures);
42 } 42 }
43 43
44 44
45 void main(List<String> args) { 45 void main(List<String> args) {
46 runClients(int.parse(args[0])) 46 runClients(int.parse(args[0]))
47 .then((_) => print('SUCCESS')); 47 .then((_) => print('SUCCESS'));
48 } 48 }
OLDNEW
« no previous file with comments | « tests/standalone/io/secure_socket_test.dart ('k') | tests/standalone/io/secure_unauthorized_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698