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

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

Issue 11263040: Make String.charCodes a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month 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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 #import("dart:isolate"); 10 #import("dart:isolate");
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 HttpClient httpClient = new HttpClient(); 166 HttpClient httpClient = new HttpClient();
167 void sendRequest() { 167 void sendRequest() {
168 HttpClientConnection conn = 168 HttpClientConnection conn =
169 httpClient.post("127.0.0.1", port, "/echo"); 169 httpClient.post("127.0.0.1", port, "/echo");
170 conn.onRequest = (HttpClientRequest request) { 170 conn.onRequest = (HttpClientRequest request) {
171 if (chunkedEncoding) { 171 if (chunkedEncoding) {
172 request.outputStream.writeString(data.substring(0, 10)); 172 request.outputStream.writeString(data.substring(0, 10));
173 request.outputStream.writeString(data.substring(10, data.length)); 173 request.outputStream.writeString(data.substring(10, data.length));
174 } else { 174 } else {
175 request.contentLength = data.length; 175 request.contentLength = data.length;
176 request.outputStream.write(data.charCodes()); 176 request.outputStream.write(data.charCodes);
177 } 177 }
178 request.outputStream.close(); 178 request.outputStream.close();
179 }; 179 };
180 conn.onResponse = (HttpClientResponse response) { 180 conn.onResponse = (HttpClientResponse response) {
181 Expect.equals(HttpStatus.OK, response.statusCode); 181 Expect.equals(HttpStatus.OK, response.statusCode);
182 InputStream stream = response.inputStream; 182 InputStream stream = response.inputStream;
183 List<int> body = new List<int>(); 183 List<int> body = new List<int>();
184 stream.onData = () { 184 stream.onData = () {
185 List tmp = new List(3); 185 List tmp = new List(3);
186 int bytes = stream.readInto(tmp); 186 int bytes = stream.readInto(tmp);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 HttpClient httpClient = new HttpClient(); 220 HttpClient httpClient = new HttpClient();
221 void sendRequest() { 221 void sendRequest() {
222 HttpClientConnection conn = 222 HttpClientConnection conn =
223 httpClient.post("127.0.0.1", port, "/echo"); 223 httpClient.post("127.0.0.1", port, "/echo");
224 conn.onRequest = (HttpClientRequest request) { 224 conn.onRequest = (HttpClientRequest request) {
225 if (chunkedEncoding) { 225 if (chunkedEncoding) {
226 request.outputStream.writeString(data.substring(0, 10)); 226 request.outputStream.writeString(data.substring(0, 10));
227 request.outputStream.writeString(data.substring(10, data.length)); 227 request.outputStream.writeString(data.substring(10, data.length));
228 } else { 228 } else {
229 request.contentLength = data.length; 229 request.contentLength = data.length;
230 request.outputStream.write(data.charCodes()); 230 request.outputStream.write(data.charCodes);
231 } 231 }
232 request.outputStream.close(); 232 request.outputStream.close();
233 }; 233 };
234 conn.onResponse = (HttpClientResponse response) { 234 conn.onResponse = (HttpClientResponse response) {
235 Expect.equals(HttpStatus.OK, response.statusCode); 235 Expect.equals(HttpStatus.OK, response.statusCode);
236 InputStream stream = response.inputStream; 236 InputStream stream = response.inputStream;
237 List<int> body = new List<int>(); 237 List<int> body = new List<int>();
238 stream.onData = () { 238 stream.onData = () {
239 List tmp = stream.read(2); 239 List tmp = stream.read(2);
240 body.addAll(tmp); 240 body.addAll(tmp);
(...skipping 20 matching lines...) Expand all
261 } 261 }
262 testServerMain.start(); 262 testServerMain.start();
263 } 263 }
264 264
265 void main() { 265 void main() {
266 testReadInto(true); 266 testReadInto(true);
267 testReadInto(false); 267 testReadInto(false);
268 testReadShort(true); 268 testReadShort(true);
269 testReadShort(false); 269 testReadShort(false);
270 } 270 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_parser_test.dart ('k') | tests/standalone/io/http_server_early_client_close_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698