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

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

Issue 226263007: issue 17992 Added extra params to message (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review updates. Renamed extraParams to context. Updated comment 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/lib/src/response.dart ('k') | pkg/shelf/test/response_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/shelf/test/request_test.dart
diff --git a/pkg/shelf/test/request_test.dart b/pkg/shelf/test/request_test.dart
index ce592c7c28a85eeaec4f5d1be66abb2c456e16c2..e4c2c4ba6f13b7d61bbc6f96ca6d8bb9717b923c 100644
--- a/pkg/shelf/test/request_test.dart
+++ b/pkg/shelf/test/request_test.dart
@@ -10,10 +10,11 @@ import 'dart:convert';
import 'package:shelf/shelf.dart';
import 'package:unittest/unittest.dart';
-Request _request([Map<String, String> headers, Stream<List<int>> body]) {
+Request _request([Map<String, String> headers, Stream<List<int>> body,
+ Map<String, Object> context]) {
if (headers == null) headers = {};
return new Request("/", "", "GET", "", "1.1", Uri.parse('http://localhost/'),
- headers, body: body);
+ headers, body: body, context: context);
}
void main() {
@@ -147,4 +148,14 @@ void main() {
}).encoding, equals(LATIN1));
});
});
+
+ group("context", () {
+ test("are correctly populated", () {
+ expect(_request({
+ 'content-type': 'text/plain'
+ }, null, {
+ 'my-param' : 42
+ }).context['my-param'], equals(42));
+ });
+ });
}
« no previous file with comments | « pkg/shelf/lib/src/response.dart ('k') | pkg/shelf/test/response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698