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

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

Issue 11783009: Big merge from experimental to bleeding edge. (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
« no previous file with comments | « pkg/http/test/multipart_test.dart ('k') | pkg/http/test/response_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/request_test.dart
diff --git a/pkg/http/test/request_test.dart b/pkg/http/test/request_test.dart
index bb4cdb01724efa105731ad266982ee68fa74b88c..1d805aa4ffbcb2583cb8e97eb0600ecf7e20aee2 100644
--- a/pkg/http/test/request_test.dart
+++ b/pkg/http/test/request_test.dart
@@ -17,11 +17,11 @@ void main() {
var request = new http.Request('POST', serverUrl);
request.body = "hello";
- var future = request.send().chain((response) {
+ var future = request.send().then((response) {
expect(response.statusCode, equals(200));
return consumeInputStream(response.stream);
- }).transform((bytes) => new String.fromCharCodes(bytes));
- future.onComplete(expectAsync1((_) {
+ }).then((bytes) => new String.fromCharCodes(bytes));
+ future.catchError((_) {}).then(expectAsync1((_) {
stopServer();
}));
@@ -192,11 +192,11 @@ void main() {
var request = new http.Request('POST', serverUrl.resolve('/redirect'))
..followRedirects = false;
- var future = request.send().transform((response) {
+ var future = request.send().then((response) {
print("#followRedirects test response received");
expect(response.statusCode, equals(302));
});
- future.onComplete(expectAsync1((_) {
+ future.catchError((_) {}).then(expectAsync1((_) {
print("#followRedirects test stopping server...");
stopServer();
print("#followRedirects test server stopped");
@@ -215,12 +215,12 @@ void main() {
var request = new http.Request('POST', serverUrl.resolve('/loop?1'))
..maxRedirects = 2;
- var future = request.send().transformException((e) {
+ var future = request.send().catchError((AsyncError e) {
print("#maxRedirects test exception received");
- expect(e, isRedirectLimitExceededException);
- expect(e.redirects.length, equals(2));
+ expect(e.error, isRedirectLimitExceededException);
+ expect(e.error.redirects.length, equals(2));
});
- future.onComplete(expectAsync1((_) {
+ future.catchError((_) {}).then(expectAsync1((_) {
print("#maxRedirects test stopping server...");
stopServer();
print("#maxRedirects test server stopped");
@@ -318,7 +318,7 @@ void main() {
request.body = "Hello, world!";
expect(
consumeInputStream(request.finalize())
- .transform((bytes) => new String.fromCharCodes(bytes)),
+ .then((bytes) => new String.fromCharCodes(bytes)),
completion(equals("Hello, world!")));
});
« no previous file with comments | « pkg/http/test/multipart_test.dart ('k') | pkg/http/test/response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698