| OLD | NEW |
| 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 // 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 "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 value += 'a'; | 281 value += 'a'; |
| 282 } | 282 } |
| 283 request.response.headers.set('name', value); | 283 request.response.headers.set('name', value); |
| 284 request.response.close().catchError((error) { | 284 request.response.close().catchError((error) { |
| 285 server.close(); | 285 server.close(); |
| 286 }, test: (e) => e is HttpException); | 286 }, test: (e) => e is HttpException); |
| 287 }); | 287 }); |
| 288 } | 288 } |
| 289 | 289 |
| 290 | 290 |
| 291 void testWriteCharCode() { |
| 292 testServerRequest((server, request) { |
| 293 // Test that default is latin-1 (only 2 bytes). |
| 294 request.response.writeCharCode(0xFF); |
| 295 request.response.writeCharCode(0xFF); |
| 296 request.response.close().then((_) { |
| 297 server.close(); |
| 298 }); |
| 299 }, bytes: 2); |
| 300 } |
| 301 |
| 302 |
| 291 void main() { | 303 void main() { |
| 292 testResponseDone(); | 304 testResponseDone(); |
| 293 testResponseAddStream(); | 305 testResponseAddStream(); |
| 294 testResponseAddStreamClosed(); | 306 testResponseAddStreamClosed(); |
| 295 testResponseAddClosed(); | 307 testResponseAddClosed(); |
| 296 testBadResponseAdd(); | 308 testBadResponseAdd(); |
| 297 testBadResponseClose(); | 309 testBadResponseClose(); |
| 298 testIgnoreRequestData(); | 310 testIgnoreRequestData(); |
| 299 testBadHeaders(); | 311 testBadHeaders(); |
| 312 testWriteCharCode(); |
| 300 } | 313 } |
| OLD | NEW |