| OLD | NEW |
| 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"; | |
| 10 | 9 |
| 11 Future<HttpServer> setupServer() { | 10 Future<HttpServer> setupServer() { |
| 12 Completer completer = new Completer(); | 11 Completer completer = new Completer(); |
| 13 HttpServer.bind("127.0.0.1", 0).then((server) { | 12 HttpServer.bind("127.0.0.1", 0).then((server) { |
| 14 | 13 |
| 15 var handlers = new Map<String, Function>(); | 14 var handlers = new Map<String, Function>(); |
| 16 addRequestHandler(String path, void handler(HttpRequest request, | 15 addRequestHandler(String path, void handler(HttpRequest request, |
| 17 HttpResponse response)) { | 16 HttpResponse response)) { |
| 18 handlers[path] = handler; | 17 handlers[path] = handler; |
| 19 } | 18 } |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 testManualRedirectWithHeaders(); | 461 testManualRedirectWithHeaders(); |
| 463 testAutoRedirect(); | 462 testAutoRedirect(); |
| 464 testAutoRedirectWithHeaders(); | 463 testAutoRedirectWithHeaders(); |
| 465 testAutoRedirect301POST(); | 464 testAutoRedirect301POST(); |
| 466 testAutoRedirect303POST(); | 465 testAutoRedirect303POST(); |
| 467 testAutoRedirectLimit(); | 466 testAutoRedirectLimit(); |
| 468 testRedirectLoop(); | 467 testRedirectLoop(); |
| 469 testRedirectClosingConnection(); | 468 testRedirectClosingConnection(); |
| 470 testRedirectRelativeUrl(); | 469 testRedirectRelativeUrl(); |
| 471 } | 470 } |
| OLD | NEW |