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

Unified Diff: tests/standalone/io/http_proxy_test.dart

Issue 11098018: Addressed drive by comments (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/http_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_proxy_test.dart
diff --git a/tests/standalone/io/http_proxy_test.dart b/tests/standalone/io/http_proxy_test.dart
index 7314e8b2f4fc35644d1ec603fc73f8100c81f991..4eb185e7d05ff3dd3c5790a15a1ad7e71ae8e638 100644
--- a/tests/standalone/io/http_proxy_test.dart
+++ b/tests/standalone/io/http_proxy_test.dart
@@ -13,7 +13,7 @@ class Server {
Server(this.proxyHops) : server = new HttpServer();
void start() {
- server.listen("127.0.0.1", 0, 5);
+ server.listen("127.0.0.1", 0);
server.defaultRequestHandler =
(HttpRequest request, HttpResponse response) {
requestCount++;
@@ -23,20 +23,20 @@ class Server {
Expect.equals(
proxyHops,
request.headers[HttpHeaders.VIA][0].split(",").length);
- } else {
- Expect.isNull(request.headers[HttpHeaders.VIA]);
- }
- StringInputStream stream = new StringInputStream(request.inputStream);
- StringBuffer body = new StringBuffer();
- stream.onData = () => body.add(stream.read());
- stream.onClosed = () {
- String path = request.path.substring(1);
- String content = "$path$path$path";
- Expect.equals(content, body.toString());
- response.outputStream.writeString(request.path);
- response.outputStream.close();
- };
- };
+ } else {
+ Expect.isNull(request.headers[HttpHeaders.VIA]);
+ }
+ StringInputStream stream = new StringInputStream(request.inputStream);
+ StringBuffer body = new StringBuffer();
+ stream.onData = () => body.add(stream.read());
+ stream.onClosed = () {
+ String path = request.path.substring(1);
+ String content = "$path$path$path";
+ Expect.equals(content, body.toString());
+ response.outputStream.writeString(request.path);
+ response.outputStream.close();
+ };
+ };
}
void shutdown() {
@@ -60,7 +60,7 @@ class ProxyServer {
ProxyServer() : server = new HttpServer(), client = new HttpClient();
void start() {
- server.listen("127.0.0.1", 0, 5);
+ server.listen("127.0.0.1", 0);
server.defaultRequestHandler =
(HttpRequest request, HttpResponse response) {
requestCount++;
« no previous file with comments | « runtime/bin/http_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698