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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 if (bytesRead < data.length) { | 307 if (bytesRead < data.length) { |
308 Expect.isTrue(bytesWritten == 0); | 308 Expect.isTrue(bytesWritten == 0); |
309 } | 309 } |
310 Expect.isTrue(client.available() > 0); | 310 Expect.isTrue(client.available() > 0); |
311 var buffer = client.read(); | 311 var buffer = client.read(); |
312 if (buffer != null) { | 312 if (buffer != null) { |
313 if (bytesRead == data.length) { | 313 if (bytesRead == data.length) { |
314 // Read first part of TLS handshake from client. | 314 // Read first part of TLS handshake from client. |
315 Expect.isTrue(postponeSecure); | 315 Expect.isTrue(postponeSecure); |
316 completer.complete([subscription, buffer]); | 316 completer.complete([subscription, buffer]); |
| 317 client.readEventsEnabled = false; |
317 return; | 318 return; |
318 } | 319 } |
319 data.setRange(bytesRead, bytesRead + buffer.length, buffer); | 320 data.setRange(bytesRead, bytesRead + buffer.length, buffer); |
320 bytesRead += buffer.length; | 321 bytesRead += buffer.length; |
321 for (var value in buffer) { | 322 for (var value in buffer) { |
322 Expect.isTrue(value is int); | 323 Expect.isTrue(value is int); |
323 Expect.isTrue(value < 256 && value >= 0); | 324 Expect.isTrue(value < 256 && value >= 0); |
324 } | 325 } |
325 } | 326 } |
326 if (bytesRead == data.length) { | 327 if (bytesRead == data.length) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 testSimpleConnectFail("not_a_nickname"); | 461 testSimpleConnectFail("not_a_nickname"); |
461 testSimpleConnectFail("CN=notARealDistinguishedName"); | 462 testSimpleConnectFail("CN=notARealDistinguishedName"); |
462 testServerListenAfterConnect(); | 463 testServerListenAfterConnect(); |
463 testSimpleReadWrite(true, true, false); | 464 testSimpleReadWrite(true, true, false); |
464 testSimpleReadWrite(true, false, false); | 465 testSimpleReadWrite(true, false, false); |
465 testSimpleReadWrite(false, true, false); | 466 testSimpleReadWrite(false, true, false); |
466 testSimpleReadWrite(false, false, false); | 467 testSimpleReadWrite(false, false, false); |
467 testSimpleReadWrite(false, false, true, true); | 468 testSimpleReadWrite(false, false, true, true); |
468 testSimpleReadWrite(false, false, true, false); | 469 testSimpleReadWrite(false, false, true, false); |
469 } | 470 } |
OLD | NEW |