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

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

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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
Index: tests/standalone/io/secure_server_client_certificate_test.dart
diff --git a/tests/standalone/io/secure_server_client_certificate_test.dart b/tests/standalone/io/secure_server_client_certificate_test.dart
index 561ea33ab656a97eb9355f5adca2a642e52b261f..e28a462d0e4080f4ac60da239fdcc7fe4a7e722c 100644
--- a/tests/standalone/io/secure_server_client_certificate_test.dart
+++ b/tests/standalone/io/secure_server_client_certificate_test.dart
@@ -26,39 +26,42 @@ InternetAddress HOST;
String localFile(path) => Platform.script.resolve(path).toFilePath();
SecurityContext serverContext(String certType, String password) =>
- new SecurityContext()
- ..useCertificateChain(localFile(
- 'certificates/server_chain.$certType'), password: password)
- ..usePrivateKey(localFile(
- 'certificates/server_key.$certType'), password: password)
- ..setTrustedCertificates(localFile(
- 'certificates/client_authority.$certType'), password: password)
- ..setClientAuthorities(localFile(
- 'certificates/client_authority.$certType'), password: password);
+ new SecurityContext()
+ ..useCertificateChain(localFile('certificates/server_chain.$certType'),
+ password: password)
+ ..usePrivateKey(localFile('certificates/server_key.$certType'),
+ password: password)
+ ..setTrustedCertificates(
+ localFile('certificates/client_authority.$certType'),
+ password: password)
+ ..setClientAuthorities(
+ localFile('certificates/client_authority.$certType'),
+ password: password);
SecurityContext clientCertContext(String certType, String password) =>
- new SecurityContext()
- ..setTrustedCertificates(localFile(
- 'certificates/trusted_certs.$certType'), password: password)
- ..useCertificateChain(localFile(
- 'certificates/client1.$certType'), password: password)
- ..usePrivateKey(localFile(
- 'certificates/client1_key.$certType'), password: password);
+ new SecurityContext()
+ ..setTrustedCertificates(
+ localFile('certificates/trusted_certs.$certType'),
+ password: password)
+ ..useCertificateChain(localFile('certificates/client1.$certType'),
+ password: password)
+ ..usePrivateKey(localFile('certificates/client1_key.$certType'),
+ password: password);
SecurityContext clientNoCertContext(String certType, String password) =>
- new SecurityContext()
- ..setTrustedCertificates(localFile(
- 'certificates/trusted_certs.$certType'), password: password);
+ new SecurityContext()
+ ..setTrustedCertificates(
+ localFile('certificates/trusted_certs.$certType'),
+ password: password);
Future testClientCertificate(
{bool required, bool sendCert, String certType, String password}) async {
- var server = await SecureServerSocket.bind(HOST, 0,
- serverContext(certType, password),
- requestClientCertificate: true,
- requireClientCertificate: required);
- var clientContext = sendCert ?
- clientCertContext(certType, password) :
- clientNoCertContext(certType, password);
+ var server = await SecureServerSocket.bind(
+ HOST, 0, serverContext(certType, password),
+ requestClientCertificate: true, requireClientCertificate: required);
+ var clientContext = sendCert
+ ? clientCertContext(certType, password)
+ : clientNoCertContext(certType, password);
var clientEndFuture =
SecureSocket.connect(HOST, server.port, context: clientContext);
if (required && !sendCert) {

Powered by Google App Engine
This is Rietveld 408576698