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

Side by Side Diff: tests/standalone/io/regress_7097_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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 import 'dart:uri'; 7 import 'dart:uri';
8 8
9 void main() { 9 void main() {
10 var client = new HttpClient(); 10 var client = new HttpClient();
(...skipping 21 matching lines...) Expand all
32 default: 32 default:
33 Expect.fail("Unexpected state"); 33 Expect.fail("Unexpected state");
34 } 34 }
35 response.outputStream.close(); 35 response.outputStream.close();
36 }; 36 };
37 }; 37 };
38 server.listen('127.0.0.1', 0); 38 server.listen('127.0.0.1', 0);
39 39
40 Future makeRequest(int n) { 40 Future makeRequest(int n) {
41 var completer = new Completer(); 41 var completer = new Completer();
42 var url = new Uri.fromString("http://localhost:${server.port}"); 42 var url = Uri.parse("http://localhost:${server.port}");
43 var connection = client.openUrl("POST", url); 43 var connection = client.openUrl("POST", url);
44 connection.onRequest = (HttpClientRequest request) { 44 connection.onRequest = (HttpClientRequest request) {
45 request.contentLength = n + 1; 45 request.contentLength = n + 1;
46 switch (n) { 46 switch (n) {
47 case 0: 47 case 0:
48 request.outputStream.writeFrom([65, 66, 67], 1, 1); 48 request.outputStream.writeFrom([65, 66, 67], 1, 1);
49 break; 49 break;
50 case 1: 50 case 1:
51 request.outputStream.writeFrom([65, 66, 67], 1); 51 request.outputStream.writeFrom([65, 66, 67], 1);
52 break; 52 break;
(...skipping 20 matching lines...) Expand all
73 73
74 makeRequest(0).then((_) { 74 makeRequest(0).then((_) {
75 makeRequest(1).then((_) { 75 makeRequest(1).then((_) {
76 makeRequest(2).then((_) { 76 makeRequest(2).then((_) {
77 client.shutdown(); 77 client.shutdown();
78 server.close(); 78 server.close();
79 }); 79 });
80 }); 80 });
81 }); 81 });
82 } 82 }
OLDNEW
« no previous file with comments | « tests/standalone/io/regress_6521_test.dart ('k') | tests/standalone/io/secure_builtin_roots_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698