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

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

Issue 13918016: Fix test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 bytesRead += buffer.length; 311 bytesRead += buffer.length;
312 for (var value in buffer) { 312 for (var value in buffer) {
313 Expect.isTrue(value is int); 313 Expect.isTrue(value is int);
314 Expect.isTrue(value < 256 && value >= 0); 314 Expect.isTrue(value < 256 && value >= 0);
315 } 315 }
316 } 316 }
317 if (bytesRead == data.length) { 317 if (bytesRead == data.length) {
318 verifyHandshakeTestData(data); 318 verifyHandshakeTestData(data);
319 client.writeEventsEnabled = true; 319 client.writeEventsEnabled = true;
320 } 320 }
321 if (bytesRead > data.length) print("XXX");
322 break; 321 break;
323 case RawSocketEvent.WRITE: 322 case RawSocketEvent.WRITE:
324 Expect.isFalse(client.writeEventsEnabled); 323 Expect.isFalse(client.writeEventsEnabled);
325 Expect.equals(bytesRead, data.length); 324 Expect.equals(bytesRead, data.length);
326 for (int i = bytesWritten; i < data.length; ++i) { 325 for (int i = bytesWritten; i < data.length; ++i) {
327 Expect.isTrue(data[i] is int); 326 Expect.isTrue(data[i] is int);
328 Expect.isTrue(data[i] < 256 && data[i] >= 0); 327 Expect.isTrue(data[i] < 256 && data[i] >= 0);
329 } 328 }
330 bytesWritten += client.write( 329 bytesWritten += client.write(
331 data, bytesWritten, data.length - bytesWritten); 330 data, bytesWritten, data.length - bytesWritten);
332 if (bytesWritten < data.length) { 331 if (bytesWritten < data.length) {
333 client.writeEventsEnabled = true; 332 client.writeEventsEnabled = true;
334 } 333 }
335 if (bytesWritten == data.length) { 334 if (bytesWritten == data.length) {
336 if (!postponeSecure) { 335 if (!postponeSecure) {
336 client.readEventsEnabled = true;
337 completer.complete([subscription, null]); 337 completer.complete([subscription, null]);
338 } 338 }
339 } 339 }
340 break; 340 break;
341 case RawSocketEvent.READ_CLOSED: 341 case RawSocketEvent.READ_CLOSED:
342 Expect.fail("Unexpected close"); 342 Expect.fail("Unexpected close");
343 break; 343 break;
344 default: throw "Unexpected event $event"; 344 default: throw "Unexpected event $event";
345 } 345 }
346 }); 346 });
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 testSimpleConnectFail("not_a_nickname"); 450 testSimpleConnectFail("not_a_nickname");
451 testSimpleConnectFail("CN=notARealDistinguishedName"); 451 testSimpleConnectFail("CN=notARealDistinguishedName");
452 testServerListenAfterConnect(); 452 testServerListenAfterConnect();
453 testSimpleReadWrite(true, true, false); 453 testSimpleReadWrite(true, true, false);
454 testSimpleReadWrite(true, false, false); 454 testSimpleReadWrite(true, false, false);
455 testSimpleReadWrite(false, true, false); 455 testSimpleReadWrite(false, true, false);
456 testSimpleReadWrite(false, false, false); 456 testSimpleReadWrite(false, false, false);
457 testSimpleReadWrite(false, false, true, true); 457 testSimpleReadWrite(false, false, true, true);
458 testSimpleReadWrite(false, false, true, false); 458 testSimpleReadWrite(false, false, true, false);
459 } 459 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698