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

Unified Diff: tests/standalone/src/io/HttpShutdownTest.dart

Issue 10252020: test rename overhaul: step 12 - standalone (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « tests/standalone/src/io/HttpServerTest.dart ('k') | tests/standalone/src/io/HttpTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/io/HttpShutdownTest.dart
diff --git a/tests/standalone/src/io/HttpShutdownTest.dart b/tests/standalone/src/io/HttpShutdownTest.dart
deleted file mode 100644
index f5a7fd2782162671b60a3b4d0b7562e4c3473afd..0000000000000000000000000000000000000000
--- a/tests/standalone/src/io/HttpShutdownTest.dart
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-//
-
-#import("dart:isolate");
-#import("dart:io");
-
-void test1(int totalConnections) {
- // Server which just closes immediately.
- HttpServer server = new HttpServer();
- server.listen("127.0.0.1", 0, totalConnections);
- server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
- response.outputStream.close();
- };
-
- int count = 0;
- HttpClient client = new HttpClient();
- for (int i = 0; i < totalConnections; i++) {
- HttpClientConnection conn = client.get("127.0.0.1", server.port, "/");
- conn.onRequest = (HttpClientRequest request) {
- request.outputStream.close();
- };
- conn.onResponse = (HttpClientResponse response) {
- count++;
- if (count == totalConnections) {
- client.shutdown();
- server.close();
- }
- };
- }
-}
-
-
-void test2(int totalConnections) {
- // Server which responds without waiting for request body.
- HttpServer server = new HttpServer();
- server.listen("127.0.0.1", 0, totalConnections);
- server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
- response.outputStream.writeString("!dlrow ,olleH");
- response.outputStream.close();
- };
-
- int count = 0;
- HttpClient client = new HttpClient();
- for (int i = 0; i < totalConnections; i++) {
- HttpClientConnection conn = client.get("127.0.0.1", server.port, "/");
- conn.onRequest = (HttpClientRequest request) {
- request.contentLength = -1;
- request.outputStream.writeString("Hello, world!");
- request.outputStream.close();
- };
- conn.onResponse = (HttpClientResponse response) {
- count++;
- if (count == totalConnections) {
- client.shutdown();
- server.close();
- }
- };
- }
-}
-
-
-void test3(int totalConnections) {
- // Server which responds when request body has been received.
- HttpServer server = new HttpServer();
- server.listen("127.0.0.1", 0, totalConnections);
- server.defaultRequestHandler = (HttpRequest request, HttpResponse response) {
- request.inputStream.onData = () {
- request.inputStream.read();
- };
- request.inputStream.onClosed = () {
- response.outputStream.writeString("!dlrow ,olleH");
- response.outputStream.close();
- };
- };
-
- int count = 0;
- HttpClient client = new HttpClient();
- for (int i = 0; i < totalConnections; i++) {
- HttpClientConnection conn = client.get("127.0.0.1", server.port, "/");
- conn.onRequest = (HttpClientRequest request) {
- request.contentLength = -1;
- request.outputStream.writeString("Hello, world!");
- request.outputStream.close();
- };
- conn.onResponse = (HttpClientResponse response) {
- count++;
- if (count == totalConnections) {
- client.shutdown();
- server.close();
- }
- };
- }
-}
-
-
-void main() {
- test1(1);
- test1(10);
- test2(1);
- test2(10);
- test3(1);
- test3(10);
-}
« no previous file with comments | « tests/standalone/src/io/HttpServerTest.dart ('k') | tests/standalone/src/io/HttpTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698