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

Unified Diff: tests/standalone/io/secure_client_server_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_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())

Powered by Google App Engine
This is Rietveld 408576698