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

Unified Diff: sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart

Issue 216373004: Use shelf handlers in ScheduledServer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 9 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: sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart
diff --git a/sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart b/sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart
index 496abcfb84e80fa0e1573bf746ad0bd27117f1e9..efd4ab445b62a18fd6bba6ab805887654b6f20c1 100644
--- a/sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart
+++ b/sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart
@@ -6,6 +6,7 @@ import 'dart:io';
import 'package:scheduled_test/scheduled_test.dart';
import 'package:scheduled_test/scheduled_server.dart';
+import 'package:shelf/shelf.dart' as shelf;
import '../../lib/src/io.dart';
import '../descriptor.dart' as d;
@@ -25,13 +26,10 @@ main() {
handleUploadForm(server);
server.handle('POST', '/upload', (request) {
- return drainStream(request).then((_) {
- request.response.statusCode = 400;
- request.response.headers.contentType =
- new ContentType('application', 'xml');
- request.response.write('<Error><Message>Your request sucked.'
- '</Message></Error>');
- request.response.close();
+ return drainStream(request.read()).then((_) {
+ return new shelf.Response.notFound(
+ '<Error><Message>Your request sucked.</Message></Error>',
+ headers: {'content-type': 'application/xml'});
});
});

Powered by Google App Engine
This is Rietveld 408576698