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

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

Issue 10386024: Add redirect support to the HTTP client (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 8 years, 7 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 | « tests/standalone/io/http_redirect_test.dart ('k') | tests/standalone/io/web_socket_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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 testServerMain.start(); 424 testServerMain.start();
425 } 425 }
426 426
427 427
428 void testReasonPhrase() { 428 void testReasonPhrase() {
429 TestServerMain testServerMain = new TestServerMain(); 429 TestServerMain testServerMain = new TestServerMain();
430 testServerMain.setServerStartedHandler((int port) { 430 testServerMain.setServerStartedHandler((int port) {
431 HttpClient httpClient = new HttpClient(); 431 HttpClient httpClient = new HttpClient();
432 HttpClientConnection conn = 432 HttpClientConnection conn =
433 httpClient.get("127.0.0.1", port, "/reasonformoving"); 433 httpClient.get("127.0.0.1", port, "/reasonformoving");
434 conn.followRedirects = false;
434 conn.onResponse = (HttpClientResponse response) { 435 conn.onResponse = (HttpClientResponse response) {
435 Expect.equals(HttpStatus.MOVED_PERMANENTLY, response.statusCode); 436 Expect.equals(HttpStatus.MOVED_PERMANENTLY, response.statusCode);
436 Expect.equals("Don't come looking here any more", response.reasonPhrase); 437 Expect.equals("Don't come looking here any more", response.reasonPhrase);
437 httpClient.shutdown(); 438 httpClient.shutdown();
438 testServerMain.shutdown(); 439 testServerMain.shutdown();
439 }; 440 };
440 }); 441 });
441 testServerMain.start(); 442 testServerMain.start();
442 } 443 }
443 444
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 testPOST(false); 522 testPOST(false);
522 testReadInto(true); 523 testReadInto(true);
523 testReadInto(false); 524 testReadInto(false);
524 testReadShort(true); 525 testReadShort(true);
525 testReadShort(false); 526 testReadShort(false);
526 test404(); 527 test404();
527 testReasonPhrase(); 528 testReasonPhrase();
528 testHost(); 529 testHost();
529 testExpires(); 530 testExpires();
530 } 531 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_redirect_test.dart ('k') | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698