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

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

Issue 11801008: Fix tests for VM in checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add missing expectAsync1 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
« no previous file with comments | « pkg/http/test/client_test.dart ('k') | pkg/http/test/request_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/http_test.dart
diff --git a/pkg/http/test/http_test.dart b/pkg/http/test/http_test.dart
index 64e06d31a85cc9d9c7ac8a6df6cd2bf9afdd8c27..3b51e9dae5e4d7b78a70dc97648f717a33004b2a 100644
--- a/pkg/http/test/http_test.dart
+++ b/pkg/http/test/http_test.dart
@@ -16,10 +16,10 @@ main() {
tearDown(stopServer);
test('head', () {
- expect(http.head(serverUrl).then(expectAsync1((response) {
+ http.head(serverUrl).then(expectAsync1((response) {
expect(response.statusCode, equals(200));
expect(response.body, equals(''));
- })), completes);
+ }));
});
test('get', () {
@@ -162,12 +162,13 @@ main() {
},
}))));
});
-
+
test('read throws an error for a 4** status code', () {
- expect(http.read(serverUrl.resolve('/error')).then((expectAsync1(x) => x)),
- throwsHttpException);
+ http.read(serverUrl.resolve('/error')).catchError(expectAsync1((e) {
+ expect(true, e.error is HttpException);
+ }));
});
-
+
test('readBytes', () {
var future = http.readBytes(serverUrl, headers: {
'X-Random-Header': 'Value',
@@ -186,8 +187,9 @@ main() {
});
test('readBytes throws an error for a 4** status code', () {
- expect(http.readBytes(serverUrl.resolve('/error')).then((expectAsync1(x) => x)),
- throwsHttpException);
+ http.readBytes(serverUrl.resolve('/error')).catchError(expectAsync1((e) {
+ expect(true, e.error is HttpException);
+ }));
});
});
}
« no previous file with comments | « pkg/http/test/client_test.dart ('k') | pkg/http/test/request_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698