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

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

Issue 12052038: Rename new Uri.fromString to Uri.parse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload because of Error. 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
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 17 matching lines...) Expand all
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( 37 var connection = client.postUrl(
38 new Uri.fromString("http://127.0.0.1:${server.port}")); 38 Uri.parse("http://127.0.0.1:${server.port}"));
39 connection.onError = (e) { throw e; }; 39 connection.onError = (e) { throw e; };
40 connection.onRequest = (request) { 40 connection.onRequest = (request) {
41 request.contentLength = "hello!".length; 41 request.contentLength = "hello!".length;
42 request.outputStream.onError = (e) { throw e; }; 42 request.outputStream.onError = (e) { throw e; };
43 request.outputStream.onClosed = () { 43 request.outputStream.onClosed = () {
44 clientOnClosed = true; 44 clientOnClosed = true;
45 checkDone(); 45 checkDone();
46 }; 46 };
47 request.outputStream.writeString("hello!"); 47 request.outputStream.writeString("hello!");
48 request.outputStream.close(); 48 request.outputStream.close();
49 }; 49 };
50 connection.onResponse = (response) { 50 connection.onResponse = (response) {
51 response.inputStream.onData = response.inputStream.read; 51 response.inputStream.onData = response.inputStream.read;
52 response.inputStream.onClosed = () { 52 response.inputStream.onClosed = () {
53 requestOnClosed = true; 53 requestOnClosed = true;
54 checkDone(); 54 checkDone();
55 }; 55 };
56 }; 56 };
57 } 57 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_redirect_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