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

Side by Side Diff: tests/standalone/io/http_basic_test.dart

Issue 11783034: Re-implement support for client redirects. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2_io/dart
Patch Set: Review fixes 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 | « sdk/lib/io/http_parser.dart ('k') | tests/standalone/io/http_redirect_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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "dart:isolate"; 10 import "dart:isolate";
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 }); 282 });
283 testServerMain.start(); 283 testServerMain.start();
284 } 284 }
285 285
286 void testReasonPhrase() { 286 void testReasonPhrase() {
287 TestServerMain testServerMain = new TestServerMain(); 287 TestServerMain testServerMain = new TestServerMain();
288 testServerMain.setServerStartedHandler((int port) { 288 testServerMain.setServerStartedHandler((int port) {
289 HttpClient httpClient = new HttpClient(); 289 HttpClient httpClient = new HttpClient();
290 httpClient.get("127.0.0.1", port, "/reasonformoving") 290 httpClient.get("127.0.0.1", port, "/reasonformoving")
291 .then((request) { 291 .then((request) {
292 // request.followRedirects = false; 292 request.followRedirects = false;
293 return request.close(); 293 return request.close();
294 }) 294 })
295 .then((response) { 295 .then((response) {
296 Expect.equals(HttpStatus.MOVED_PERMANENTLY, response.statusCode); 296 Expect.equals(HttpStatus.MOVED_PERMANENTLY, response.statusCode);
297 Expect.equals("Don't come looking here any more", 297 Expect.equals("Don't come looking here any more",
298 response.reasonPhrase); 298 response.reasonPhrase);
299 response.listen( 299 response.listen(
300 (data) => Expect.fail("No data expected"), 300 (data) => Expect.fail("No data expected"),
301 onDone: () { 301 onDone: () {
302 httpClient.close(); 302 httpClient.close();
303 testServerMain.close(); 303 testServerMain.close();
304 }); 304 });
305 }); 305 });
306 }); 306 });
307 testServerMain.start(); 307 testServerMain.start();
308 } 308 }
309 309
310 void main() { 310 void main() {
311 testStartStop(); 311 testStartStop();
312 testGET(); 312 testGET();
313 testPOST(true); 313 testPOST(true);
314 testPOST(false); 314 testPOST(false);
315 test404(); 315 test404();
316 testReasonPhrase(); 316 testReasonPhrase();
317 } 317 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_parser.dart ('k') | tests/standalone/io/http_redirect_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698