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

Side by Side Diff: tests/standalone/src/io/HttpServerEarlyCloseTest.dart

Issue 9958063: Rename Http test to be more specific. (Closed) Base URL: http://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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/src/io/HttpServerEarlyServerCloseTest.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #import("dart:io");
2 #import("dart:isolate");
3
4 class Server {
5 Server() {
6 HttpServer server = new HttpServer();
7 server.listen("127.0.0.1", 0);
8 port = server.port;
9 server.onRequest = (HttpRequest request, HttpResponse response) {
10 new Timer(100, (timer) => server.close());
11 };
12 server.onError = (Object exception) {
13 Expect.fail("Close should not give an error.");
14 };
15 }
16 int port;
17 }
18
19 class Client {
20 Client(int port) {
21 ReceivePort r = new ReceivePort();
22 HttpClient client = new HttpClient();
23 HttpClientConnection c = client.get("127.0.0.1", port, "/");
24 c.onRequest = (HttpClientRequest request) {
25 request.outputStream.close();
26 };
27 c.onResponse = (HttpClientResponse response) {
28 Expect.fail("Response should not be given, as not data was returned.");
29 };
30 c.onError = (Object exception) {
31 r.close();
32 };
33 }
34 }
35
36 main() {
37 Server server = new Server();
38 new Client(server.port);
39 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/src/io/HttpServerEarlyServerCloseTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698