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

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

Issue 1665433002: Adds SecurityContext.setTrustedCertificatesBytes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Adds MemBIOScope 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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 library dart.io; 10 library dart.io;
(...skipping 16 matching lines...) Expand all
27 27
28 String localFile(path) => Platform.script.resolve(path).toFilePath(); 28 String localFile(path) => Platform.script.resolve(path).toFilePath();
29 List<int> readLocalFile(path) => (new File(localFile(path))).readAsBytesSync(); 29 List<int> readLocalFile(path) => (new File(localFile(path))).readAsBytesSync();
30 30
31 SecurityContext serverContext = new SecurityContext() 31 SecurityContext serverContext = new SecurityContext()
32 ..useCertificateChainBytes(readLocalFile('certificates/server_chain.pem')) 32 ..useCertificateChainBytes(readLocalFile('certificates/server_chain.pem'))
33 ..usePrivateKeyBytes(readLocalFile('certificates/server_key.pem'), 33 ..usePrivateKeyBytes(readLocalFile('certificates/server_key.pem'),
34 password: 'dartdart'); 34 password: 'dartdart');
35 35
36 SecurityContext clientContext = new SecurityContext() 36 SecurityContext clientContext = new SecurityContext()
37 ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem')); 37 ..setTrustedCertificatesBytes(
38 readLocalFile('certificates/trusted_certs.pem'));
38 39
39 /** 40 /**
40 * A SecurityConfiguration lets us run the tests over HTTP or HTTPS. 41 * A SecurityConfiguration lets us run the tests over HTTP or HTTPS.
41 */ 42 */
42 class SecurityConfiguration { 43 class SecurityConfiguration {
43 final bool secure; 44 final bool secure;
44 45
45 SecurityConfiguration({bool this.secure}); 46 SecurityConfiguration({bool this.secure});
46 47
47 Future<HttpServer> createServer({int backlog: 0}) => 48 Future<HttpServer> createServer({int backlog: 0}) =>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 103
103 104
104 main() { 105 main() {
105 asyncStart(); 106 asyncStart();
106 new SecurityConfiguration(secure: false).runTests(); 107 new SecurityConfiguration(secure: false).runTests();
107 // TODO(whesse): WebSocket.connect needs an optional context: parameter 108 // TODO(whesse): WebSocket.connect needs an optional context: parameter
108 // new SecurityConfiguration(secure: true).runTests(); 109 // new SecurityConfiguration(secure: true).runTests();
109 asyncEnd(); 110 asyncEnd();
110 } 111 }
111 112
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698