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

Unified Diff: pkg/http/test/multipart_test.dart

Issue 216603010: Rip out dart:io from pkg/http wherever possible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review 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
« no previous file with comments | « pkg/http/test/http_test.dart ('k') | pkg/http/test/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/multipart_test.dart
diff --git a/pkg/http/test/multipart_test.dart b/pkg/http/test/multipart_test.dart
index f8cb322ea9c18fe38fe426a8c5d98ef50a2170fa..a3f0f8e92997da44a287c691aa0840ad51213c1f 100644
--- a/pkg/http/test/multipart_test.dart
+++ b/pkg/http/test/multipart_test.dart
@@ -9,6 +9,7 @@ import 'dart:convert';
import 'dart:io';
import 'package:http/http.dart' as http;
+import 'package:http_parser/http_parser.dart';
import 'package:path/path.dart' as path;
import 'package:unittest/unittest.dart';
@@ -30,7 +31,7 @@ class _BodyMatches extends Matcher {
var future = item.finalize().toBytes().then((bodyBytes) {
var body = UTF8.decode(bodyBytes);
- var contentType = ContentType.parse(item.headers['content-type']);
+ var contentType = new MediaType.parse(item.headers['content-type']);
var boundary = contentType.parameters['boundary'];
var expected = cleanUpLiteral(_pattern)
.replaceAll("\n", "\r\n")
@@ -188,7 +189,7 @@ void main() {
test('with a string file with a content-type but no charset', () {
var request = new http.MultipartRequest('POST', dummyUrl);
var file = new http.MultipartFile.fromString('file', '{"hello": "world"}',
- contentType: new ContentType('application', 'json'));
+ contentType: new MediaType('application', 'json'));
request.files.add(file);
expect(request, bodyMatches('''
@@ -205,7 +206,7 @@ void main() {
var request = new http.MultipartRequest('POST', dummyUrl);
// "Ã¥" encoded as ISO-8859-1 and then read as UTF-8 results in "å".
var file = new http.MultipartFile.fromString('file', 'non-ascii: "Ã¥"',
- contentType: new ContentType('text', 'plain', charset: 'iso-8859-1'));
+ contentType: new MediaType('text', 'plain', {'charset': 'iso-8859-1'}));
request.files.add(file);
expect(request, bodyMatches('''
« no previous file with comments | « pkg/http/test/http_test.dart ('k') | pkg/http/test/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698