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

Side by Side Diff: utils/tests/pub/curl_client_test.dart

Issue 12021022: Stop supporting map literals with 1 type argument (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
« runtime/vm/parser.cc ('K') | « utils/pub/utils.dart ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 curl_client_test; 5 library curl_client_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:isolate'; 8 import 'dart:isolate';
9 import 'dart:json' as json; 9 import 'dart:json' as json;
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 var encoding = requiredEncodingForCharset( 98 var encoding = requiredEncodingForCharset(
99 request.headers.contentType.charset); 99 request.headers.contentType.charset);
100 requestBody = decodeString(requestBodyBytes, encoding); 100 requestBody = decodeString(requestBodyBytes, encoding);
101 } else { 101 } else {
102 requestBody = requestBodyBytes; 102 requestBody = requestBodyBytes;
103 } 103 }
104 104
105 var content = { 105 var content = {
106 'method': request.method, 106 'method': request.method,
107 'path': request.path, 107 'path': request.path,
108 'headers': <String>{} 108 'headers': <String, String>{}
109 }; 109 };
110 if (requestBody != null) content['body'] = requestBody; 110 if (requestBody != null) content['body'] = requestBody;
111 request.headers.forEach((name, values) { 111 request.headers.forEach((name, values) {
112 // These headers are automatically generated by dart:io, so we don't 112 // These headers are automatically generated by dart:io, so we don't
113 // want to test them here. 113 // want to test them here.
114 if (name == 'cookie' || name == 'host') return; 114 if (name == 'cookie' || name == 'host') return;
115 115
116 content['headers'][name] = values; 116 content['headers'][name] = values;
117 }); 117 });
118 118
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 test('without following redirects', () { 451 test('without following redirects', () {
452 var request = new http.Request('GET', serverUrl.resolve('/redirect')); 452 var request = new http.Request('GET', serverUrl.resolve('/redirect'));
453 request.followRedirects = false; 453 request.followRedirects = false;
454 expect(new CurlClient().send(request).then(http.Response.fromStream) 454 expect(new CurlClient().send(request).then(http.Response.fromStream)
455 .then((response) { 455 .then((response) {
456 expect(response.statusCode, equals(302)); 456 expect(response.statusCode, equals(302));
457 expect(response.isRedirect, true); 457 expect(response.isRedirect, true);
458 }), completes); 458 }), completes);
459 }); 459 });
460 } 460 }
OLDNEW
« runtime/vm/parser.cc ('K') | « utils/pub/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698