Index: tests/standalone/io/secure_client_server_test.dart |
diff --git a/tests/standalone/io/secure_client_server_test.dart b/tests/standalone/io/secure_client_server_test.dart |
index 1c169081e1a1abb5185d4d01f9ea0bc4f586b7c6..ac76bbb9504c5165b1e5bada15ff27df05ba66d1 100644 |
--- a/tests/standalone/io/secure_client_server_test.dart |
+++ b/tests/standalone/io/secure_client_server_test.dart |
@@ -23,44 +23,43 @@ String localFile(path) => Platform.script.resolve(path).toFilePath(); |
SecurityContext serverContext = new SecurityContext() |
..useCertificateChain(localFile('certificates/server_chain.pem')) |
..usePrivateKey(localFile('certificates/server_key.pem'), |
- password: 'dartdart'); |
+ password: 'dartdart'); |
SecurityContext clientContext = new SecurityContext() |
- ..setTrustedCertificates( |
- localFile('certificates/trusted_certs.pem')); |
- |
+ ..setTrustedCertificates(localFile('certificates/trusted_certs.pem')); |
Future<SecureServerSocket> startEchoServer() { |
- return SecureServerSocket.bind(HOST, |
- 0, |
- serverContext).then((server) { |
+ return SecureServerSocket.bind(HOST, 0, serverContext).then((server) { |
server.listen((SecureSocket client) { |
- client.fold(<int>[], (message, data) => message..addAll(data)) |
- .then((message) { |
- client.add(message); |
- client.close(); |
- }); |
+ client.fold(<int>[], (message, data) => message..addAll(data)).then( |
+ (message) { |
+ client.add(message); |
+ client.close(); |
+ }); |
}); |
return server; |
}); |
} |
Future testClient(server) { |
- return SecureSocket.connect(HOST, server.port, context: clientContext) |
- .then((socket) { |
+ return SecureSocket |
+ .connect(HOST, server.port, context: clientContext) |
+ .then((socket) { |
socket.write("Hello server."); |
socket.close(); |
- return socket.fold(<int>[], (message, data) => message..addAll(data)) |
- .then((message) { |
- Expect.listEquals("Hello server.".codeUnits, message); |
- return server; |
- }); |
+ return socket.fold(<int>[], (message, data) => message..addAll(data)).then( |
+ (message) { |
+ Expect.listEquals("Hello server.".codeUnits, message); |
+ return server; |
+ }); |
}); |
} |
void main() { |
asyncStart(); |
- InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first ) |
+ InternetAddress |
+ .lookup("localhost") |
+ .then((hosts) => HOST = hosts.first) |
.then((_) => startEchoServer()) |
.then(testClient) |
.then((server) => server.close()) |