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

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

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed second round of review comments Created 7 years, 9 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 5
6 import "dart:io"; 6 import "dart:io";
7 import "dart:uri"; 7 import "dart:uri";
8 8
9 main() { 9 main() {
10 bool serverOnClosed = false; 10 bool serverOnClosed = false;
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 server.listen((request) { 24 server.listen((request) {
25 request.listen( 25 request.listen(
26 (_) {}, 26 (_) {},
27 onDone: () { 27 onDone: () {
28 request.response.done.then((_) { 28 request.response.done.then((_) {
29 serverOnClosed = true; 29 serverOnClosed = true;
30 checkDone(); 30 checkDone();
31 }); 31 });
32 request.response.addString("hello!"); 32 request.response.write("hello!");
33 request.response.close(); 33 request.response.close();
34 }); 34 });
35 }); 35 });
36 36
37 client.postUrl(Uri.parse("http://127.0.0.1:${server.port}")) 37 client.postUrl(Uri.parse("http://127.0.0.1:${server.port}"))
38 .then((request) { 38 .then((request) {
39 request.contentLength = "hello!".length; 39 request.contentLength = "hello!".length;
40 request.done.then((_) { 40 request.done.then((_) {
41 clientOnClosed = true; 41 clientOnClosed = true;
42 checkDone(); 42 checkDone();
43 }); 43 });
44 request.addString("hello!"); 44 request.write("hello!");
45 return request.close(); 45 return request.close();
46 }) 46 })
47 .then((response) { 47 .then((response) {
48 response.listen( 48 response.listen(
49 (_) {}, 49 (_) {},
50 onDone: () { 50 onDone: () {
51 requestOnClosed = true; 51 requestOnClosed = true;
52 checkDone(); 52 checkDone();
53 }); 53 });
54 }); 54 });
55 }); 55 });
56 } 56 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_shutdown_test.dart ('k') | tests/standalone/io/https_client_certificate_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698