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

Unified Diff: tests/standalone/io/http_client_request_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/http_client_request_test.dart
diff --git a/tests/standalone/io/http_client_request_test.dart b/tests/standalone/io/http_client_request_test.dart
index cd2a7beb045adca865c1232f7cea83fe1780d193..dae2b2aae6eed0a3bec7476d18bef8a00be6e68d 100644
--- a/tests/standalone/io/http_client_request_test.dart
+++ b/tests/standalone/io/http_client_request_test.dart
@@ -9,30 +9,27 @@ import "dart:typed_data";
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
-
void testClientRequest(Future handler(request)) {
HttpServer.bind("127.0.0.1", 0).then((server) {
server.listen((request) {
- request.drain()
- .then((_) => request.response.close())
- .catchError((_) {});
+ request.drain().then((_) => request.response.close()).catchError((_) {});
});
var client = new HttpClient();
- client.get("127.0.0.1", server.port, "/")
- .then((request) {
- return handler(request);
- })
- .then((response) => response.drain())
- .catchError((_) {})
- .whenComplete(() {
- client.close();
- server.close();
- });
+ client
+ .get("127.0.0.1", server.port, "/")
+ .then((request) {
+ return handler(request);
+ })
+ .then((response) => response.drain())
+ .catchError((_) {})
+ .whenComplete(() {
+ client.close();
+ server.close();
+ });
});
}
-
void testResponseDone() {
testClientRequest((request) {
request.close().then((res1) {
@@ -44,7 +41,6 @@ void testResponseDone() {
});
}
-
void testBadResponseAdd() {
asyncStart();
testClientRequest((request) {
@@ -83,7 +79,6 @@ void testBadResponseAdd() {
});
}
-
void testBadResponseClose() {
asyncStart();
testClientRequest((request) {
@@ -107,7 +102,6 @@ void testBadResponseClose() {
});
}
-
void main() {
testResponseDone();
testBadResponseAdd();

Powered by Google App Engine
This is Rietveld 408576698