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

Unified Diff: pkg/shelf/test/shelf_io_test.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/response_test.dart ('k') | pkg/shelf/test/test_util.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/test/shelf_io_test.dart
diff --git a/pkg/shelf/test/shelf_io_test.dart b/pkg/shelf/test/shelf_io_test.dart
index 1fa0e96f4642623b417d888aa4927c29d0967a0e..5152a697e7083b8db79e665e5c6c3b6b13e720de 100644
--- a/pkg/shelf/test/shelf_io_test.dart
+++ b/pkg/shelf/test/shelf_io_test.dart
@@ -84,10 +84,10 @@ void main() {
var expectedUrl = 'http://localhost:$_serverPort$path';
expect(request.requestedUri, Uri.parse(expectedUrl));
- expect(request.pathInfo, '/foo/bar');
- expect(request.pathSegments, ['foo', 'bar']);
+ expect(request.url.path, '/foo/bar');
+ expect(request.url.pathSegments, ['foo', 'bar']);
expect(request.protocolVersion, '1.1');
- expect(request.queryString, 'qs=value');
+ expect(request.url.query, 'qs=value');
expect(request.scriptName, '');
return syncHandler(request);
@@ -129,11 +129,16 @@ void main() {
test('custom request headers are received by the handler', () {
_scheduleServer((request) {
expect(request.headers, containsPair('custom-header', 'client value'));
+
+ // dart:io HttpServer splits multi-value headers into an array
+ // validate that they are combined correctly
+ expect(request.headers, containsPair('multi-header', 'foo,bar,baz'));
return syncHandler(request);
});
var headers = {
- 'custom-header': 'client value'
+ 'custom-header': 'client value',
+ 'multi-header': 'foo,bar,baz'
};
return _scheduleGet(headers: headers).then((response) {
« no previous file with comments | « pkg/shelf/test/response_test.dart ('k') | pkg/shelf/test/test_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698