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

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

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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/http/test/safe_http_server.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 request_test; 5 library request_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:http/http.dart' as http; 9 import 'package:http/http.dart' as http;
10 import 'package:http/src/utils.dart'; 10 import 'package:http/src/utils.dart';
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 test('#maxRedirects', () { 209 test('#maxRedirects', () {
210 print("This test is known to be flaky, please ignore " 210 print("This test is known to be flaky, please ignore "
211 "(debug prints below added by sgjesse@)"); 211 "(debug prints below added by sgjesse@)");
212 print("#maxRedirects test starting server..."); 212 print("#maxRedirects test starting server...");
213 expect(startServer().then((_) { 213 expect(startServer().then((_) {
214 print("#maxRedirects test server running"); 214 print("#maxRedirects test server running");
215 215
216 var request = new http.Request('POST', serverUrl.resolve('/loop?1')) 216 var request = new http.Request('POST', serverUrl.resolve('/loop?1'))
217 ..maxRedirects = 2; 217 ..maxRedirects = 2;
218 var future = request.send().catchError((e) { 218 var future = request.send().catchError((error) {
219 print("#maxRedirects test exception received"); 219 print("#maxRedirects test exception received");
220 expect(e.error, isRedirectLimitExceededException); 220 expect(error, isRedirectLimitExceededException);
221 expect(e.error.redirects.length, equals(2)); 221 expect(error.redirects.length, equals(2));
222 }); 222 });
223 expect(future.catchError((_) {}).then((_) { 223 expect(future.catchError((_) {}).then((_) {
224 print("#maxRedirects test stopping server..."); 224 print("#maxRedirects test stopping server...");
225 stopServer(); 225 stopServer();
226 print("#maxRedirects test server stopped"); 226 print("#maxRedirects test server stopped");
227 }), completes); 227 }), completes);
228 228
229 expect(future, completes); 229 expect(future, completes);
230 print("#maxRedirects test started"); 230 print("#maxRedirects test started");
231 }), completes); 231 }), completes);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 }); 388 });
389 389
390 group('#toString()', () { 390 group('#toString()', () {
391 test('includes the method and URL', () { 391 test('includes the method and URL', () {
392 var request = new http.Request('POST', dummyUrl); 392 var request = new http.Request('POST', dummyUrl);
393 expect(request.toString(), 'POST $dummyUrl'); 393 expect(request.toString(), 'POST $dummyUrl');
394 }); 394 });
395 }); 395 });
396 } 396 }
397 397
OLDNEW
« no previous file with comments | « pkg/http/lib/src/utils.dart ('k') | pkg/http/test/safe_http_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698