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

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

Issue 14753009: Make StreamSubscription be the active part of a stream. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 6 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_parser_test.dart ('k') | tests/standalone/io/pipe_server_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) 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 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import "dart:async"; 7 import "dart:async";
8 import "dart:io"; 8 import "dart:io";
9 import "dart:uri"; 9 import "dart:uri";
10 10
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 Expect.fail("Redirect of POST should not happen"); 190 Expect.fail("Redirect of POST should not happen");
191 } 191 }
192 ); 192 );
193 193
194 // Setup redirect for 303 where POST should turn into GET. 194 // Setup redirect for 303 where POST should turn into GET.
195 addRequestHandler( 195 addRequestHandler(
196 "/303src", 196 "/303src",
197 (HttpRequest request, HttpResponse response) { 197 (HttpRequest request, HttpResponse response) {
198 request.listen((_) {}, onDone: () { 198 request.listen((_) {}, onDone: () {
199 Expect.equals("POST", request.method); 199 Expect.equals("POST", request.method);
200 request.listen( 200 response.headers.set(
201 (_) {}, 201 HttpHeaders.LOCATION,
202 onDone: () { 202 "http://127.0.0.1:${server.port}/303target");
203 response.headers.set( 203 response.statusCode = HttpStatus.SEE_OTHER;
204 HttpHeaders.LOCATION, 204 response.close();
205 "http://127.0.0.1:${server.port}/303target");
206 response.statusCode = HttpStatus.SEE_OTHER;
207 response.close();
208 });
209 }); 205 });
210 }); 206 });
211 addRequestHandler( 207 addRequestHandler(
212 "/303target", 208 "/303target",
213 (HttpRequest request, HttpResponse response) { 209 (HttpRequest request, HttpResponse response) {
214 Expect.equals("GET", request.method); 210 Expect.equals("GET", request.method);
215 response.close(); 211 response.close();
216 }); 212 });
217 213
218 // Setup redirect where we close the connection. 214 // Setup redirect where we close the connection.
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 testManualRedirectWithHeaders(); 462 testManualRedirectWithHeaders();
467 testAutoRedirect(); 463 testAutoRedirect();
468 testAutoRedirectWithHeaders(); 464 testAutoRedirectWithHeaders();
469 testAutoRedirect301POST(); 465 testAutoRedirect301POST();
470 testAutoRedirect303POST(); 466 testAutoRedirect303POST();
471 testAutoRedirectLimit(); 467 testAutoRedirectLimit();
472 testRedirectLoop(); 468 testRedirectLoop();
473 testRedirectClosingConnection(); 469 testRedirectClosingConnection();
474 testRedirectRelativeUrl(); 470 testRedirectRelativeUrl();
475 } 471 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_parser_test.dart ('k') | tests/standalone/io/pipe_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698