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

Unified Diff: tests/standalone/src/SocketCloseTest.dart

Issue 9368058: Revert "Fix potential flakiness of SocketStreamCloseTest." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/socket_impl.dart ('k') | tests/standalone/src/SocketStreamCloseTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/SocketCloseTest.dart
diff --git a/tests/standalone/src/SocketCloseTest.dart b/tests/standalone/src/SocketCloseTest.dart
index 2f2f18220d6e8067e96e0b0bdc74d960f4bd31bb..ea7daf3646136c88f8d8e217a3df20038ca6b9a7 100644
--- a/tests/standalone/src/SocketCloseTest.dart
+++ b/tests/standalone/src/SocketCloseTest.dart
@@ -2,11 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
//
-// VMOptions=
-// VMOptions=--short_socket_read
-// VMOptions=--short_socket_write
-// VMOptions=--short_socket_read --short_socket_write
-//
// Test socket close events.
#import("dart:io");
@@ -101,15 +96,6 @@ class SocketClose {
_socket.closeHandler = closeHandler;
_socket.errorHandler = errorHandler;
- void writeHello() {
- int bytesWritten = 0;
- while (bytesWritten != 5) {
- bytesWritten += _socket.writeList("Hello".charCodes(),
- bytesWritten,
- 5 - bytesWritten);
- }
- }
-
_iterations++;
switch (_mode) {
case 0:
@@ -117,23 +103,28 @@ class SocketClose {
proceed();
break;
case 1:
- writeHello();
+ int bytesWritten = _socket.writeList("Hello".charCodes(), 0, 5);
+ Expect.equals(5, bytesWritten);
_socket.close();
proceed();
break;
case 2:
case 3:
- writeHello();
+ int bytesWritten = _socket.writeList("Hello".charCodes(), 0, 5);
+ Expect.equals(5, bytesWritten);
break;
case 4:
- writeHello();
+ int bytesWritten = _socket.writeList("Hello".charCodes(), 0, 5);
+ Expect.equals(5, bytesWritten);
_socket.close(true);
break;
case 5:
- writeHello();
+ int bytesWritten = _socket.writeList("Hello".charCodes(), 0, 5);
+ Expect.equals(5, bytesWritten);
break;
case 6:
- writeHello();
+ int bytesWritten = _socket.writeList("Hello".charCodes(), 0, 5);
+ Expect.equals(5, bytesWritten);
_socket.close(true);
break;
default:
@@ -212,47 +203,35 @@ class SocketCloseServer extends Isolate {
}
}
- void writeHello() {
- int bytesWritten = 0;
- while (bytesWritten != 5) {
- bytesWritten += connection.writeList("Hello".charCodes(),
- bytesWritten,
- 5 - bytesWritten);
- }
- }
-
void dataHandler() {
+ _dataEvents++;
switch (_mode) {
case 0:
Expect.fail("No data expected");
break;
case 1:
- readBytes(() { _dataEvents++; });
+ readBytes(() { });
break;
case 2:
readBytes(() {
- _dataEvents++;
connection.close();
});
break;
case 3:
readBytes(() {
- _dataEvents++;
- writeHello();
+ connection.writeList("Hello".charCodes(), 0, 5);
connection.close();
});
break;
case 4:
readBytes(() {
- _dataEvents++;
- writeHello();
+ connection.writeList("Hello".charCodes(), 0, 5);
});
break;
case 5:
case 6:
readBytes(() {
- _dataEvents++;
- writeHello();
+ connection.writeList("Hello".charCodes(), 0, 5);
connection.close(true);
});
break;
« no previous file with comments | « runtime/bin/socket_impl.dart ('k') | tests/standalone/src/SocketStreamCloseTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698