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

Unified Diff: pkg/http/test/client_test.dart

Issue 11830017: Fix ALL the pub tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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: pkg/http/test/client_test.dart
diff --git a/pkg/http/test/client_test.dart b/pkg/http/test/client_test.dart
index d2f149c6344c8c72e3491f51e5860bf61f495b5a..97eacda4d23dff26a182a8fcc43eaa0965e86f62 100644
--- a/pkg/http/test/client_test.dart
+++ b/pkg/http/test/client_test.dart
@@ -5,6 +5,7 @@
library client_test;
import 'dart:io';
+import 'dart:uri';
import 'package:unittest/unittest.dart';
import 'package:http/http.dart' as http;
@@ -38,4 +39,17 @@ void main() {
request.sink.add('{"hello": "world"}'.charCodes);
request.sink.close();
});
+
+ test('#send with an invalid URL', () {
+ var client = new http.Client();
+ var url = new Uri.fromString('http://http.invalid');
+ var request = new http.StreamedRequest("POST", url);
+ request.headers[HttpHeaders.CONTENT_TYPE] =
+ 'application/json; charset=utf-8';
+
+ expect(client.send(request), throwsSocketIOException);
+
+ request.sink.add('{"hello": "world"}'.charCodes);
+ request.sink.close();
+ });
}
« no previous file with comments | « pkg/http/lib/src/io_client.dart ('k') | pkg/http/test/utils.dart » ('j') | utils/pub/git.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698