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

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

Issue 66603002: Improve the HTTP client error when the provided URI is not suitable (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 1 month 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
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e557e8d6db8e38c10c49063071264eab941c5a25..e3e5957028e1f911a1b1181c3753ec90adf13d83 100644
--- a/tests/standalone/io/http_client_exception_test.dart
+++ b/tests/standalone/io/http_client_exception_test.dart
@@ -11,7 +11,26 @@ import "package:expect/expect.dart";
void testInvalidUrl() {
HttpClient client = new HttpClient();
Expect.throws(
- () => client.getUrl(Uri.parse('ftp://www.google.com')));
+ () => client.getUrl(Uri.parse('ftp://www.google.com')),
+ (e) => e.toString().contains("Unsupported scheme"));
+ Expect.throws(
+ () => client.getUrl(Uri.parse('httpx://www.google.com')),
+ (e) => e.toString().contains("Unsupported scheme"));
+ Expect.throws(
+ () => client.getUrl(Uri.parse('http://::1')),
+ (e) => e.toString().contains("No host specified"));
+ Expect.throws(
+ () => client.getUrl(Uri.parse('http:///')),
+ (e) => e.toString().contains("No host specified"));
+ Expect.throws(
+ () => client.getUrl(Uri.parse('http:///index.html')),
+ (e) => e.toString().contains("No host specified"));
+ Expect.throws(
+ () => client.getUrl(Uri.parse('///')),
+ (e) => e.toString().contains("No host specified"));
+ Expect.throws(
+ () => client.getUrl(Uri.parse('///index.html')),
+ (e) => e.toString().contains("No host specified"));
}
void testBadHostName() {
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698