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

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

Issue 11801008: Fix tests for VM in checked mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add missing expectAsync1 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/test/http_test.dart ('k') | 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 request_test; 5 library request_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 import 'package:http/http.dart' as http; 10 import 'package:http/http.dart' as http;
(...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 startServer(); 213 startServer();
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((AsyncError e) { 218 var future = request.send().catchError((e) {
219 print("#maxRedirects test exception received"); 219 print("#maxRedirects test exception received");
220 expect(e.error, isRedirectLimitExceededException); 220 expect(e.error, isRedirectLimitExceededException);
221 expect(e.error.redirects.length, equals(2)); 221 expect(e.error.redirects.length, equals(2));
222 }); 222 });
223 future.catchError((_) {}).then(expectAsync1((_) { 223 future.catchError((_) {}).then(expectAsync1((_) {
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 })); 227 }));
228 228
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 }); 389 });
390 390
391 group('#toString()', () { 391 group('#toString()', () {
392 test('includes the method and URL', () { 392 test('includes the method and URL', () {
393 var request = new http.Request('POST', dummyUrl); 393 var request = new http.Request('POST', dummyUrl);
394 expect(request.toString(), 'POST $dummyUrl'); 394 expect(request.toString(), 'POST $dummyUrl');
395 }); 395 });
396 }); 396 });
397 } 397 }
398 398
OLDNEW
« no previous file with comments | « pkg/http/test/http_test.dart ('k') | pkg/oauth2/test/authorization_code_grant_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698