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

Side by Side Diff: pkg/shelf/test/request_test.dart

Issue 232073005: Addressed comments from review https://codereview.chromium.org/226263007 Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/shelf/lib/src/response.dart ('k') | pkg/shelf/test/response_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library shelf.request_test; 5 library shelf.request_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:shelf/shelf.dart'; 9 import 'package:shelf/shelf.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
11 11
12 import 'test_util.dart'; 12 import 'test_util.dart';
13 13
14 Request _request([Map<String, String> headers, Stream<List<int>> body]) { 14 Request _request([Map<String, String> headers, Stream<List<int>> body,
15 return new Request("GET", LOCALHOST_URI, headers: headers, body: body); 15 Map<String, Object> context]) {
16 return new Request("GET", LOCALHOST_URI, headers: headers, body: body,
17 context: context);
16 } 18 }
17 19
18 void main() { 20 void main() {
19 group('constructor', () { 21 group('constructor', () {
20 test('protocolVersion defaults to "1.1"', () { 22 test('protocolVersion defaults to "1.1"', () {
21 var request = new Request('GET', LOCALHOST_URI); 23 var request = new Request('GET', LOCALHOST_URI);
22 expect(request.protocolVersion, '1.1'); 24 expect(request.protocolVersion, '1.1');
23 }); 25 });
24 26
25 test('provide non-default protocolVersion', () { 27 test('provide non-default protocolVersion', () {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 ]))); 173 ])));
172 174
173 controller.add([104, 101, 108, 108, 111, 44]); 175 controller.add([104, 101, 108, 108, 111, 44]);
174 return new Future(() { 176 return new Future(() {
175 controller 177 controller
176 ..add([32, 119, 111, 114, 108, 100]) 178 ..add([32, 119, 111, 114, 108, 100])
177 ..close(); 179 ..close();
178 }); 180 });
179 }); 181 });
180 }); 182 });
183
184 group("context", () {
185 test("is correctly populated", () {
186 expect(_request({
187 'content-type': 'text/plain'
188 }, null, {
189 'my-param' : 42
190 }).context['my-param'], equals(42));
191 });
192 });
181 } 193 }
OLDNEW
« 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