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

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

Issue 11852017: Fix dart2js compilation error in previous commit (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16 matching lines...) Expand all
27 request.inputStream.onClosed = () { 27 request.inputStream.onClosed = () {
28 response.outputStream.onClosed = () { 28 response.outputStream.onClosed = () {
29 serverOnClosed = true; 29 serverOnClosed = true;
30 checkDone(); 30 checkDone();
31 }; 31 };
32 response.outputStream.writeString("hello!"); 32 response.outputStream.writeString("hello!");
33 response.outputStream.close(); 33 response.outputStream.close();
34 }; 34 };
35 }; 35 };
36 36
37 var connection = client.postUrl(new Uri.fromString("http://127.0.0.1:${server. port}")); 37 var connection = client.postUrl(
38 connection.onError = (e) => throw e; 38 new Uri.fromString("http://127.0.0.1:${server.port}"));
39 connection.onError = (e) { throw e; };
39 connection.onRequest = (request) { 40 connection.onRequest = (request) {
40 request.contentLength = "hello!".length; 41 request.contentLength = "hello!".length;
41 request.outputStream.onError = (e) => throw e; 42 request.outputStream.onError = (e) { throw e; };
42 request.outputStream.onClosed = () { 43 request.outputStream.onClosed = () {
43 clientOnClosed = true; 44 clientOnClosed = true;
44 checkDone(); 45 checkDone();
45 }; 46 };
46 request.outputStream.writeString("hello!"); 47 request.outputStream.writeString("hello!");
47 request.outputStream.close(); 48 request.outputStream.close();
48 }; 49 };
49 connection.onResponse = (response) { 50 connection.onResponse = (response) {
50 response.inputStream.onData = response.inputStream.read; 51 response.inputStream.onData = response.inputStream.read;
51 response.inputStream.onClosed = () { 52 response.inputStream.onClosed = () {
52 requestOnClosed = true; 53 requestOnClosed = true;
53 checkDone(); 54 checkDone();
54 }; 55 };
55 }; 56 };
56 } 57 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698