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

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

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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
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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:io"; 6 import "dart:io";
7 import "dart:isolate"; 7 import "dart:isolate";
8 8
9 void testListenOn() { 9 void testListenOn() {
10 ServerSocket socket; 10 ServerSocket socket;
(...skipping 11 matching lines...) Expand all
22 }) 22 })
23 .then((response) { 23 .then((response) {
24 response.listen( 24 response.listen(
25 (_) {}, 25 (_) {},
26 onDone: () { 26 onDone: () {
27 client.close(); 27 client.close();
28 clientPort.close(); 28 clientPort.close();
29 onDone(); 29 onDone();
30 }); 30 });
31 }) 31 })
32 .catchError((error) { 32 .catchError((e) {
33 Expect.fail("Unexpected error in Http Client: $error"); 33 String msg = "Unexpected error in Http Client: $e";
34 var trace = getAttachedStackTrace(e);
35 if (trace != null) msg += "\nStackTrace: $trace";
36 Expect.fail(msg);
34 }); 37 });
35 } 38 }
36 39
37 // Test two connection after each other. 40 // Test two connection after each other.
38 ServerSocket.bind().then((s) { 41 ServerSocket.bind().then((s) {
39 socket = s; 42 socket = s;
40 server = new HttpServer.listenOn(socket); 43 server = new HttpServer.listenOn(socket);
41 ReceivePort serverPort = new ReceivePort(); 44 ReceivePort serverPort = new ReceivePort();
42 server.listen((HttpRequest request) { 45 server.listen((HttpRequest request) {
43 request.listen( 46 request.listen(
(...skipping 10 matching lines...) Expand all
54 Expect.throws(() => server.port); 57 Expect.throws(() => server.port);
55 socket.close(); 58 socket.close();
56 }); 59 });
57 }); 60 });
58 }); 61 });
59 } 62 }
60 63
61 void main() { 64 void main() {
62 testListenOn(); 65 testListenOn();
63 } 66 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_server_response_test.dart ('k') | tests/standalone/io/https_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698