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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 Expect.isTrue(data[i] is int); | 326 Expect.isTrue(data[i] is int); |
327 Expect.isTrue(data[i] < 256 && data[i] >= 0); | 327 Expect.isTrue(data[i] < 256 && data[i] >= 0); |
328 } | 328 } |
329 bytesWritten += client.write( | 329 bytesWritten += client.write( |
330 data, bytesWritten, data.length - bytesWritten); | 330 data, bytesWritten, data.length - bytesWritten); |
331 if (bytesWritten < data.length) { | 331 if (bytesWritten < data.length) { |
332 client.writeEventsEnabled = true; | 332 client.writeEventsEnabled = true; |
333 } | 333 } |
334 if (bytesWritten == data.length) { | 334 if (bytesWritten == data.length) { |
335 if (!postponeSecure) { | 335 if (!postponeSecure) { |
336 client.readEventsEnabled = true; | |
337 completer.complete([subscription, null]); | 336 completer.complete([subscription, null]); |
338 } | 337 } |
339 } | 338 } |
340 break; | 339 break; |
341 case RawSocketEvent.READ_CLOSED: | 340 case RawSocketEvent.READ_CLOSED: |
342 Expect.fail("Unexpected close"); | 341 Expect.fail("Unexpected close"); |
343 break; | 342 break; |
344 default: throw "Unexpected event $event"; | 343 default: throw "Unexpected event $event"; |
345 } | 344 } |
346 }); | 345 }); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 testSimpleConnectFail("not_a_nickname"); | 449 testSimpleConnectFail("not_a_nickname"); |
451 testSimpleConnectFail("CN=notARealDistinguishedName"); | 450 testSimpleConnectFail("CN=notARealDistinguishedName"); |
452 testServerListenAfterConnect(); | 451 testServerListenAfterConnect(); |
453 testSimpleReadWrite(true, true, false); | 452 testSimpleReadWrite(true, true, false); |
454 testSimpleReadWrite(true, false, false); | 453 testSimpleReadWrite(true, false, false); |
455 testSimpleReadWrite(false, true, false); | 454 testSimpleReadWrite(false, true, false); |
456 testSimpleReadWrite(false, false, false); | 455 testSimpleReadWrite(false, false, false); |
457 testSimpleReadWrite(false, false, true, true); | 456 testSimpleReadWrite(false, false, true, true); |
458 testSimpleReadWrite(false, false, true, false); | 457 testSimpleReadWrite(false, false, true, false); |
459 } | 458 } |
OLD | NEW |