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

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

Issue 256753004: pkg/shelf: change helper method on Request and Response (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: nevermind Created 6 years, 7 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/test/response_test.dart ('k') | pkg/shelf/test/test_util.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_io_test; 5 library shelf_io_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io'; 9 import 'dart:io';
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 return new Future.error('test'); 68 return new Future.error('test');
69 }); 69 });
70 70
71 return _scheduleGet().then((response) { 71 return _scheduleGet().then((response) {
72 expect(response.statusCode, HttpStatus.INTERNAL_SERVER_ERROR); 72 expect(response.statusCode, HttpStatus.INTERNAL_SERVER_ERROR);
73 expect(response.body, 'Internal Server Error'); 73 expect(response.body, 'Internal Server Error');
74 }); 74 });
75 }); 75 });
76 76
77 test('Request is populated correctly', () { 77 test('Request is populated correctly', () {
78 var path = '/foo/bar?qs=value#anchor'; 78 var path = '/foo/bar?qs=value';
79 79
80 _scheduleServer((request) { 80 _scheduleServer((request) {
81 expect(request.contentLength, 0); 81 expect(request.contentLength, 0);
82 expect(request.method, 'GET'); 82 expect(request.method, 'GET');
83 83
84 var expectedUrl = 'http://localhost:$_serverPort$path'; 84 var expectedUrl = 'http://localhost:$_serverPort$path';
85 expect(request.requestedUri, Uri.parse(expectedUrl)); 85 expect(request.requestedUri, Uri.parse(expectedUrl));
86 86
87 expect(request.url.path, '/foo/bar'); 87 expect(request.url.path, '/foo/bar');
88 expect(request.url.pathSegments, ['foo', 'bar']); 88 expect(request.url.pathSegments, ['foo', 'bar']);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 var request = new http.Request('POST', 246 var request = new http.Request('POST',
247 Uri.parse('http://localhost:$_serverPort/')); 247 Uri.parse('http://localhost:$_serverPort/'));
248 248
249 if (headers != null) request.headers.addAll(headers); 249 if (headers != null) request.headers.addAll(headers);
250 if (body != null) request.body = body; 250 if (body != null) request.body = body;
251 251
252 return request.send(); 252 return request.send();
253 }); 253 });
254 } 254 }
OLDNEW
« 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