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

Side by Side Diff: pkg/http/test/utils.dart

Issue 12045024: Fix map literals from change 17410 (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
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | pkg/oauth2/lib/src/utils.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) 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 test_utils; 5 library test_utils;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 import 'dart:json' as json; 9 import 'dart:json' as json;
10 import 'dart:uri'; 10 import 'dart:uri';
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 var encoding = requiredEncodingForCharset( 63 var encoding = requiredEncodingForCharset(
64 request.headers.contentType.charset); 64 request.headers.contentType.charset);
65 requestBody = decodeString(requestBodyBytes, encoding); 65 requestBody = decodeString(requestBodyBytes, encoding);
66 } else { 66 } else {
67 requestBody = requestBodyBytes; 67 requestBody = requestBodyBytes;
68 } 68 }
69 69
70 var content = { 70 var content = {
71 'method': request.method, 71 'method': request.method,
72 'path': request.path, 72 'path': request.path,
73 'headers': <String, String>{} 73 'headers': {}
74 }; 74 };
75 if (requestBody != null) content['body'] = requestBody; 75 if (requestBody != null) content['body'] = requestBody;
76 request.headers.forEach((name, values) { 76 request.headers.forEach((name, values) {
77 // These headers are automatically generated by dart:io, so we don't 77 // These headers are automatically generated by dart:io, so we don't
78 // want to test them here. 78 // want to test them here.
79 if (name == 'cookie' || name == 'host') return; 79 if (name == 'cookie' || name == 'host') return;
80 80
81 content['headers'][name] = values; 81 content['headers'][name] = values;
82 }); 82 });
83 83
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 const isSocketIOException = const _SocketIOException(); 183 const isSocketIOException = const _SocketIOException();
184 184
185 /// A matcher for functions that throw SocketIOException. 185 /// A matcher for functions that throw SocketIOException.
186 const Matcher throwsSocketIOException = 186 const Matcher throwsSocketIOException =
187 const Throws(isSocketIOException); 187 const Throws(isSocketIOException);
188 188
189 class _SocketIOException extends TypeMatcher { 189 class _SocketIOException extends TypeMatcher {
190 const _SocketIOException() : super("SocketIOException"); 190 const _SocketIOException() : super("SocketIOException");
191 bool matches(item, MatchState matchState) => item is SocketIOException; 191 bool matches(item, MatchState matchState) => item is SocketIOException;
192 } 192 }
OLDNEW
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | pkg/oauth2/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698