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

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

Issue 11659009: Reapply "Fix URI encoding/decoding of + and space"" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated tests Created 8 years 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 | « no previous file | pkg/oauth2/test/authorization_code_grant_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) 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 http_test; 5 library http_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import '../../unittest/lib/unittest.dart'; 9 import '../../unittest/lib/unittest.dart';
10 import '../lib/http.dart' as http; 10 import '../lib/http.dart' as http;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 'other-field': 'other value' 49 'other-field': 'other value'
50 }).transform((response) { 50 }).transform((response) {
51 expect(response.statusCode, equals(200)); 51 expect(response.statusCode, equals(200));
52 expect(response.body, parse(equals({ 52 expect(response.body, parse(equals({
53 'method': 'POST', 53 'method': 'POST',
54 'path': '/', 54 'path': '/',
55 'headers': { 55 'headers': {
56 'content-type': [ 56 'content-type': [
57 'application/x-www-form-urlencoded; charset=UTF-8' 57 'application/x-www-form-urlencoded; charset=UTF-8'
58 ], 58 ],
59 'content-length': ['42'], 59 'content-length': ['40'],
60 'x-random-header': ['Value'], 60 'x-random-header': ['Value'],
61 'x-other-header': ['Other Value'] 61 'x-other-header': ['Other Value']
62 }, 62 },
63 'body': 'some-field=value&other-field=other%20value' 63 'body': 'some-field=value&other-field=other+value'
64 }))); 64 })));
65 }), completes); 65 }), completes);
66 }); 66 });
67 67
68 test('post without fields', () { 68 test('post without fields', () {
69 expect(http.post(serverUrl, headers: { 69 expect(http.post(serverUrl, headers: {
70 'X-Random-Header': 'Value', 70 'X-Random-Header': 'Value',
71 'X-Other-Header': 'Other Value', 71 'X-Other-Header': 'Other Value',
72 'Content-Type': 'text/plain' 72 'Content-Type': 'text/plain'
73 }).transform((response) { 73 }).transform((response) {
(...skipping 20 matching lines...) Expand all
94 'other-field': 'other value' 94 'other-field': 'other value'
95 }).transform((response) { 95 }).transform((response) {
96 expect(response.statusCode, equals(200)); 96 expect(response.statusCode, equals(200));
97 expect(response.body, parse(equals({ 97 expect(response.body, parse(equals({
98 'method': 'PUT', 98 'method': 'PUT',
99 'path': '/', 99 'path': '/',
100 'headers': { 100 'headers': {
101 'content-type': [ 101 'content-type': [
102 'application/x-www-form-urlencoded; charset=UTF-8' 102 'application/x-www-form-urlencoded; charset=UTF-8'
103 ], 103 ],
104 'content-length': ['42'], 104 'content-length': ['40'],
105 'x-random-header': ['Value'], 105 'x-random-header': ['Value'],
106 'x-other-header': ['Other Value'] 106 'x-other-header': ['Other Value']
107 }, 107 },
108 'body': 'some-field=value&other-field=other%20value' 108 'body': 'some-field=value&other-field=other+value'
109 }))); 109 })));
110 }), completes); 110 }), completes);
111 }); 111 });
112 112
113 test('put without fields', () { 113 test('put without fields', () {
114 expect(http.put(serverUrl, headers: { 114 expect(http.put(serverUrl, headers: {
115 'X-Random-Header': 'Value', 115 'X-Random-Header': 'Value',
116 'X-Other-Header': 'Other Value', 116 'X-Other-Header': 'Other Value',
117 'Content-Type': 'text/plain' 117 'Content-Type': 'text/plain'
118 }).transform((response) { 118 }).transform((response) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 'x-other-header': ['Other Value'] 182 'x-other-header': ['Other Value']
183 }, 183 },
184 })))); 184 }))));
185 }); 185 });
186 186
187 test('readBytes throws an error for a 4** status code', () { 187 test('readBytes throws an error for a 4** status code', () {
188 expect(http.readBytes(serverUrl.resolve('/error')), throwsHttpException); 188 expect(http.readBytes(serverUrl.resolve('/error')), throwsHttpException);
189 }); 189 });
190 }); 190 });
191 } 191 }
OLDNEW
« no previous file with comments | « no previous file | pkg/oauth2/test/authorization_code_grant_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698