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

Unified Diff: pkg/shelf/test/test_util.dart

Issue 227563010: pkg/shelf: case-insensitive headers, cleaner Request ctor, a lot more tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixing dependent code, changelog Created 6 years, 8 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/shelf/test/shelf_io_test.dart ('k') | sdk/lib/_internal/pub/lib/src/oauth2.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/test/test_util.dart
diff --git a/pkg/shelf/test/test_util.dart b/pkg/shelf/test/test_util.dart
index bc1793b7f97dafd892774ab6a97cc9c41ce8be86..10afe995c06570f3fc3753763d32f9aa46dc0bdd 100644
--- a/pkg/shelf/test/test_util.dart
+++ b/pkg/shelf/test/test_util.dart
@@ -12,12 +12,12 @@ import 'package:shelf/src/util.dart';
/// A simple, synchronous handler for [Request].
///
/// By default, replies with a status code 200, empty headers, and
-/// `Hello from ${request.pathInfo}`.
+/// `Hello from ${request.url.path}`.
Response syncHandler(Request request, {int statusCode,
Map<String, String> headers}) {
if (statusCode == null) statusCode = 200;
return new Response(statusCode, headers: headers,
- body: 'Hello from ${request.pathInfo}');
+ body: 'Hello from ${request.url.path}');
}
/// Calls [syncHandler] and wraps the response in a [Future].
@@ -28,5 +28,6 @@ Future<Response> asyncHandler(Request request) =>
Future<Response> makeSimpleRequest(Handler handler) =>
syncFuture(() => handler(_request));
-final _request = new Request('/', '', 'GET', '', '1.1',
- Uri.parse('http://localhost/'), {});
+final _request = new Request('GET', LOCALHOST_URI);
+
+final LOCALHOST_URI = Uri.parse('http://localhost/');
« no previous file with comments | « pkg/shelf/test/shelf_io_test.dart ('k') | sdk/lib/_internal/pub/lib/src/oauth2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698