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

Unified Diff: utils/tests/pub/pub_uploader_test.dart

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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 | « utils/tests/pub/pub_lish_test.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/pub_uploader_test.dart
diff --git a/utils/tests/pub/pub_uploader_test.dart b/utils/tests/pub/pub_uploader_test.dart
index 2ac8722d436334066451003278c390340ed47041..d8f8721ed89c7d25802feb9875de3d68a8553bd1 100644
--- a/utils/tests/pub/pub_uploader_test.dart
+++ b/utils/tests/pub/pub_uploader_test.dart
@@ -54,14 +54,14 @@ main() {
var pub = startPubUploader(server, ['--package', 'pkg', 'add', 'email']);
server.handle('POST', '/packages/pkg/uploaders.json', (request, response) {
- expect(wrapInputStream(request.inputStream).toBytes().then((bodyBytes) {
+ expect(new ByteStream(request).toBytes().then((bodyBytes) {
expect(new String.fromCharCodes(bodyBytes), equals('email=email'));
response.headers.contentType = new ContentType("application", "json");
- response.outputStream.writeString(json.stringify({
+ response.addString(json.stringify({
'success': {'message': 'Good job!'}
}));
- response.outputStream.close();
+ response.close();
}), completes);
});
@@ -77,10 +77,10 @@ main() {
server.handle('DELETE', '/packages/pkg/uploaders/email.json',
(request, response) {
response.headers.contentType = new ContentType("application", "json");
- response.outputStream.writeString(json.stringify({
+ response.addString(json.stringify({
'success': {'message': 'Good job!'}
}));
- response.outputStream.close();
+ response.close();
});
expectLater(pub.nextLine(), equals('Good job!'));
@@ -97,10 +97,10 @@ main() {
server.handle('POST', '/packages/test_pkg/uploaders.json',
(request, response) {
response.headers.contentType = new ContentType("application", "json");
- response.outputStream.writeString(json.stringify({
+ response.addString(json.stringify({
'success': {'message': 'Good job!'}
}));
- response.outputStream.close();
+ response.close();
});
expectLater(pub.nextLine(), equals('Good job!'));
@@ -115,10 +115,10 @@ main() {
server.handle('POST', '/packages/pkg/uploaders.json', (request, response) {
response.statusCode = 400;
response.headers.contentType = new ContentType("application", "json");
- response.outputStream.writeString(json.stringify({
+ response.addString(json.stringify({
'error': {'message': 'Bad job!'}
}));
- response.outputStream.close();
+ response.close();
});
expectLater(pub.nextErrLine(), equals('Bad job!'));
@@ -135,10 +135,10 @@ main() {
(request, response) {
response.statusCode = 400;
response.headers.contentType = new ContentType("application", "json");
- response.outputStream.writeString(json.stringify({
+ response.addString(json.stringify({
'error': {'message': 'Bad job!'}
}));
- response.outputStream.close();
+ response.close();
});
expectLater(pub.nextErrLine(), equals('Bad job!'));
@@ -151,8 +151,8 @@ main() {
var pub = startPubUploader(server, ['--package', 'pkg', 'add', 'email']);
server.handle('POST', '/packages/pkg/uploaders.json', (request, response) {
- response.outputStream.writeString("{not json");
- response.outputStream.close();
+ response.addString("{not json");
+ response.close();
});
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
@@ -167,8 +167,8 @@ main() {
server.handle('DELETE', '/packages/pkg/uploaders/email.json',
(request, response) {
- response.outputStream.writeString("{not json");
- response.outputStream.close();
+ response.addString("{not json");
+ response.close();
});
expectLater(pub.nextErrLine(), equals('Invalid server response:'));
« no previous file with comments | « utils/tests/pub/pub_lish_test.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698