Index: utils/tests/pub/pub_lish_test.dart |
diff --git a/utils/tests/pub/pub_lish_test.dart b/utils/tests/pub/pub_lish_test.dart |
index eb7dca0e7b5348539446676e8978c827f853877f..58f6a1983ed7f4008f9c3206de1d791237a669b4 100644 |
--- a/utils/tests/pub/pub_lish_test.dart |
+++ b/utils/tests/pub/pub_lish_test.dart |
@@ -13,7 +13,7 @@ import '../../pub/io.dart'; |
void handleUploadForm(ScheduledServer server, [Map body]) { |
server.handle('GET', '/packages/versions/new.json', (request, response) { |
- return server.url.chain((url) { |
+ return server.url.transform((url) { |
expect(request.headers.value('authorization'), |
equals('Bearer access token')); |
@@ -29,7 +29,7 @@ void handleUploadForm(ScheduledServer server, [Map body]) { |
response.headers.contentType = new ContentType("application", "json"); |
response.outputStream.writeString(JSON.stringify(body)); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
}); |
} |
@@ -38,10 +38,10 @@ void handleUpload(ScheduledServer server) { |
server.handle('POST', '/upload', (request, response) { |
// TODO(nweiz): Once a multipart/form-data parser in Dart exists, validate |
// that the request body is correctly formatted. See issue 6952. |
- return server.url.chain((url) { |
+ return server.url.transform((url) { |
response.statusCode = 302; |
response.headers.set('location', url.resolve('/create').toString()); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
}); |
} |
@@ -65,7 +65,7 @@ main() { |
response.outputStream.writeString(JSON.stringify({ |
'success': {'message': 'Package test_pkg 1.0.0 uploaded!'} |
})); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextLine(), equals('Package test_pkg 1.0.0 uploaded!')); |
@@ -89,7 +89,7 @@ main() { |
response.outputStream.writeString(JSON.stringify({ |
'error': {'message': 'your token sucks'} |
})); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextErrLine(), equals('OAuth2 authorization failed (your ' |
@@ -150,7 +150,7 @@ main() { |
response.outputStream.writeString(JSON.stringify({ |
'success': {'message': 'Package test_pkg 1.0.0 uploaded!'} |
})); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
pub.shouldExit(0); |
@@ -170,7 +170,7 @@ main() { |
response.outputStream.writeString(JSON.stringify({ |
'error': {'message': 'your request sucked'} |
})); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextErrLine(), equals('your request sucked')); |
@@ -186,7 +186,7 @@ main() { |
server.handle('GET', '/packages/versions/new.json', (request, response) { |
response.outputStream.writeString('{not json'); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextErrLine(), equals('Invalid server response:')); |
@@ -312,7 +312,7 @@ main() { |
server.handle('POST', '/upload', (request, response) { |
// don't set the location header |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextErrLine(), equals('Failed to upload the package.')); |
@@ -333,7 +333,7 @@ main() { |
response.outputStream.writeString(JSON.stringify({ |
'error': {'message': 'Your package was too boring.'} |
})); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextErrLine(), equals('Your package was too boring.')); |
@@ -351,7 +351,7 @@ main() { |
server.handle('GET', '/create', (request, response) { |
response.outputStream.writeString('{not json'); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextErrLine(), equals('Invalid server response:')); |
@@ -372,7 +372,7 @@ main() { |
server.handle('GET', '/create', (request, response) { |
response.statusCode = 400; |
response.outputStream.writeString(JSON.stringify(body)); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextErrLine(), equals('Invalid server response:')); |
@@ -392,7 +392,7 @@ main() { |
var body = {'success': 'Your package was awesome.'}; |
server.handle('GET', '/create', (request, response) { |
response.outputStream.writeString(JSON.stringify(body)); |
- return closeHttpResponse(request, response); |
+ response.outputStream.close(); |
}); |
expectLater(pub.nextErrLine(), equals('Invalid server response:')); |