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

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: 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..75cc659f7fdc372734d58711254107ada0d8a305 100644
--- a/tests/standalone/io/http_client_exception_test.dart
+++ b/tests/standalone/io/http_client_exception_test.dart
@@ -11,7 +11,14 @@ 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')),
Bill Hesse 2013/11/08 14:54:32 Also add a test for http:///index.html?
Søren Gjesse 2013/11/28 13:47:19 Good point. Added http:///, /// and ///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