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

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: 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: pkg/shelf/test/request_test.dart
diff --git a/pkg/shelf/test/request_test.dart b/pkg/shelf/test/request_test.dart
index ce592c7c28a85eeaec4f5d1be66abb2c456e16c2..f0a713be431ea1da0dc47faae7c872986cfaf81c 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> extraParams]) {
if (headers == null) headers = {};
return new Request("/", "", "GET", "", "1.1", Uri.parse('http://localhost/'),
- headers, body: body);
+ headers, body: body, extraParams: extraParams);
}
void main() {
@@ -147,4 +148,14 @@ void main() {
}).encoding, equals(LATIN1));
});
});
+
+ group("extraParams", () {
+ test("are correctly populated", () {
+ expect(_request({
+ 'content-type': 'text/plain'
+ }, null, {
+ 'my-param' : 42
+ }).extraParams['my-param'], equals(42));
+ });
+ });
}

Powered by Google App Engine
This is Rietveld 408576698