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

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

Issue 1616073004: Adds SecurityContext.usePrivateKeyBytes (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments 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 import "dart:async"; 10 import "dart:async";
11 import "dart:io"; 11 import "dart:io";
12 12
13 import "package:async_helper/async_helper.dart"; 13 import "package:async_helper/async_helper.dart";
14 import "package:expect/expect.dart"; 14 import "package:expect/expect.dart";
15 15
16 InternetAddress HOST; 16 InternetAddress HOST;
17 String localFile(path) => Platform.script.resolve(path).toFilePath(); 17 String localFile(path) => Platform.script.resolve(path).toFilePath();
18 List<int> readLocalFile(path) => (new File(localFile(path))).readAsBytesSync();
18 19
19 SecurityContext serverContext = new SecurityContext() 20 SecurityContext serverContext = new SecurityContext()
20 ..useCertificateChain(localFile('certificates/server_chain.pem')) 21 ..useCertificateChain(localFile('certificates/server_chain.pem'))
21 ..usePrivateKey(localFile('certificates/server_key.pem'), 22 ..usePrivateKeyAsBytes(readLocalFile('certificates/server_key.pem'),
22 password: 'dartdart'); 23 password: 'dartdart');
23 24
24 SecurityContext clientContext = new SecurityContext() 25 SecurityContext clientContext = new SecurityContext()
25 ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem')); 26 ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
26 27
27 void testCloseOneEnd(String toClose) { 28 void testCloseOneEnd(String toClose) {
28 asyncStart(); 29 asyncStart();
29 Completer serverDone = new Completer(); 30 Completer serverDone = new Completer();
30 Completer serverEndDone = new Completer(); 31 Completer serverEndDone = new Completer();
31 Completer clientEndDone = new Completer(); 32 Completer clientEndDone = new Completer();
32 Future.wait([serverDone.future, serverEndDone.future, clientEndDone.future]) 33 Future.wait([serverDone.future, serverEndDone.future, clientEndDone.future])
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 168
168 runTests() { 169 runTests() {
169 testCloseOneEnd("client"); 170 testCloseOneEnd("client");
170 testCloseOneEnd("server"); 171 testCloseOneEnd("server");
171 testCloseBothEnds(); 172 testCloseBothEnds();
172 testCloseServer(); 173 testCloseServer();
173 testPauseServerSocket(); 174 testPauseServerSocket();
174 // TODO(whesse): Add testPauseSocket from raw_socket_test.dart. 175 // TODO(whesse): Add testPauseSocket from raw_socket_test.dart.
175 // TODO(whesse): Add testCancelResubscribeSocket from raw_socket_test.dart. 176 // TODO(whesse): Add testCancelResubscribeSocket from raw_socket_test.dart.
176 } 177 }
OLDNEW
« no previous file with comments | « tests/standalone/io/https_unauthorized_test.dart ('k') | tests/standalone/io/raw_secure_server_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698