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

Unified Diff: tests/standalone/io/http_client_exception_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_exception_test.dart
diff --git a/tests/standalone/io/http_client_exception_test.dart b/tests/standalone/io/http_client_exception_test.dart
index a2bb7a851f79dd33703f2db43125eebc4094f63b..3e8234da4ff99d666bc4995c8f9cb5133957cbd5 100644
--- a/tests/standalone/io/http_client_exception_test.dart
+++ b/tests/standalone/io/http_client_exception_test.dart
@@ -10,41 +10,32 @@ import "package:expect/expect.dart";
void testInvalidUrl() {
HttpClient client = new HttpClient();
- Expect.throws(
- () => client.getUrl(Uri.parse('ftp://www.google.com')),
+ Expect.throws(() => client.getUrl(Uri.parse('ftp://www.google.com')),
(e) => e.toString().contains("Unsupported scheme"));
- Expect.throws(
- () => client.getUrl(Uri.parse('httpx://www.google.com')),
+ Expect.throws(() => client.getUrl(Uri.parse('httpx://www.google.com')),
(e) => e.toString().contains("Unsupported scheme"));
- Expect.throws(
- () => client.getUrl(Uri.parse('http://::1')),
+ Expect.throws(() => client.getUrl(Uri.parse('http://::1')),
(e) => e is FormatException);
- Expect.throws(
- () => client.getUrl(Uri.parse('http://user@:1')),
+ Expect.throws(() => client.getUrl(Uri.parse('http://user@:1')),
(e) => e.toString().contains("No host specified"));
- Expect.throws(
- () => client.getUrl(Uri.parse('http:///')),
+ Expect.throws(() => client.getUrl(Uri.parse('http:///')),
(e) => e.toString().contains("No host specified"));
- Expect.throws(
- () => client.getUrl(Uri.parse('http:///index.html')),
+ Expect.throws(() => client.getUrl(Uri.parse('http:///index.html')),
(e) => e.toString().contains("No host specified"));
- Expect.throws(
- () => client.getUrl(Uri.parse('///')),
+ Expect.throws(() => client.getUrl(Uri.parse('///')),
(e) => e.toString().contains("No host specified"));
- Expect.throws(
- () => client.getUrl(Uri.parse('///index.html')),
+ Expect.throws(() => client.getUrl(Uri.parse('///index.html')),
(e) => e.toString().contains("No host specified"));
}
void testBadHostName() {
asyncStart();
HttpClient client = new HttpClient();
- client.get("some.bad.host.name.7654321", 0, "/")
- .then((request) {
- Expect.fail("Should not open a request on bad hostname");
- }).catchError((error) {
- asyncEnd(); // We expect onError to be called, due to bad host name.
- }, test: (error) => error is! String);
+ client.get("some.bad.host.name.7654321", 0, "/").then((request) {
+ Expect.fail("Should not open a request on bad hostname");
+ }).catchError((error) {
+ asyncEnd(); // We expect onError to be called, due to bad host name.
+ }, test: (error) => error is! String);
}
void main() {

Powered by Google App Engine
This is Rietveld 408576698