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

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

Issue 1757453002: Rolls back fix of SecurityContext method names. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import "dart:async"; 5 import "dart:async";
6 import "dart:io"; 6 import "dart:io";
7 import "dart:isolate"; 7 import "dart:isolate";
8 8
9 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
10 10
11 InternetAddress HOST; 11 InternetAddress HOST;
12 12
13 String localFile(path) => Platform.script.resolve(path).toFilePath(); 13 String localFile(path) => Platform.script.resolve(path).toFilePath();
14 14
15 SecurityContext serverContext = new SecurityContext() 15 SecurityContext serverContext = new SecurityContext()
16 ..useCertificateChainSync(localFile('certificates/server_chain.pem')) 16 ..useCertificateChain(localFile('certificates/server_chain.pem'))
17 ..usePrivateKeySync(localFile('certificates/server_key.pem'), 17 ..usePrivateKey(localFile('certificates/server_key.pem'),
18 password: 'dartdart'); 18 password: 'dartdart');
19 19
20 SecurityContext clientContext = new SecurityContext() 20 SecurityContext clientContext = new SecurityContext()
21 ..setTrustedCertificatesSync(localFile('certificates/trusted_certs.pem')); 21 ..setTrustedCertificates(localFile('certificates/trusted_certs.pem'));
22 22
23 void testListenOn() { 23 void testListenOn() {
24 void test(void onDone()) { 24 void test(void onDone()) {
25 HttpServer.bindSecure(HOST, 25 HttpServer.bindSecure(HOST,
26 0, 26 0,
27 serverContext, 27 serverContext,
28 backlog: 5).then((server) { 28 backlog: 5).then((server) {
29 ReceivePort serverPort = new ReceivePort(); 29 ReceivePort serverPort = new ReceivePort();
30 server.listen((HttpRequest request) { 30 server.listen((HttpRequest request) {
31 request.listen( 31 request.listen(
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 }); 98 });
99 } 99 }
100 100
101 void main() { 101 void main() {
102 InternetAddress.lookup("localhost").then((hosts) { 102 InternetAddress.lookup("localhost").then((hosts) {
103 HOST = hosts.first; 103 HOST = hosts.first;
104 testListenOn(); 104 testListenOn();
105 testEarlyClientClose(); 105 testEarlyClientClose();
106 }); 106 });
107 } 107 }
OLDNEW
« no previous file with comments | « tests/standalone/io/https_client_certificate_test.dart ('k') | tests/standalone/io/https_unauthorized_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698