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

Unified Diff: tests/standalone/io/raw_secure_server_closing_test.dart

Issue 23886004: Update dart:io tests to use asyncStart/asyncEnd (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 3 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 | « tests/standalone/io/process_pid_test.dart ('k') | tests/standalone/io/raw_secure_server_socket_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/raw_secure_server_closing_test.dart
diff --git a/tests/standalone/io/raw_secure_server_closing_test.dart b/tests/standalone/io/raw_secure_server_closing_test.dart
index 1157a4815b0ef84a9cf16fbefac9d7431c57aa6a..f2f03779334f312ddb95f5f4788db997a841b53d 100644
--- a/tests/standalone/io/raw_secure_server_closing_test.dart
+++ b/tests/standalone/io/raw_secure_server_closing_test.dart
@@ -7,23 +7,24 @@
// VMOptions=--short_socket_write
// VMOptions=--short_socket_read --short_socket_write
-import "package:expect/expect.dart";
-import "package:path/path.dart";
import "dart:async";
import "dart:io";
-import "dart:isolate";
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+import "package:path/path.dart";
const HOST_NAME = "localhost";
const CERTIFICATE = "localhost_cert";
void testCloseOneEnd(String toClose) {
- ReceivePort port = new ReceivePort();
+ asyncStart();
Completer serverDone = new Completer();
Completer serverEndDone = new Completer();
Completer clientEndDone = new Completer();
Future.wait([serverDone.future, serverEndDone.future, clientEndDone.future])
.then((_) {
- port.close();
+ asyncEnd();
});
RawSecureServerSocket.bind(HOST_NAME, 0, CERTIFICATE).then((server) {
server.listen((serverConnection) {
@@ -54,7 +55,7 @@ void testCloseOneEnd(String toClose) {
}
void testCloseBothEnds() {
- ReceivePort port = new ReceivePort();
+ asyncStart();
RawSecureServerSocket.bind(HOST_NAME, 0, CERTIFICATE).then((server) {
var clientEndFuture = RawSecureSocket.connect(HOST_NAME, server.port);
server.listen((serverEnd) {
@@ -62,7 +63,7 @@ void testCloseBothEnds() {
clientEnd.close();
serverEnd.close();
server.close();
- port.close();
+ asyncEnd();
});
});
});
@@ -73,7 +74,7 @@ testPauseServerSocket() {
var acceptCount = 0;
var resumed = false;
- ReceivePort port = new ReceivePort();
+ asyncStart();
RawSecureServerSocket.bind(HOST_NAME,
0,
@@ -86,7 +87,7 @@ testPauseServerSocket() {
connection.shutdown(SocketDirection.SEND);
if (++acceptCount == 2 * socketCount) {
server.close();
- port.close();
+ asyncEnd();
}
});
@@ -114,7 +115,7 @@ testPauseServerSocket() {
testCloseServer() {
const int socketCount = 3;
- ReceivePort port = new ReceivePort();
+ asyncStart();
List ends = [];
RawSecureServerSocket.bind(HOST_NAME, 0, CERTIFICATE).then((server) {
@@ -125,7 +126,7 @@ testCloseServer() {
end.close();
}
server.close();
- port.close();
+ asyncEnd();
}
server.listen((connection) {
« no previous file with comments | « tests/standalone/io/process_pid_test.dart ('k') | tests/standalone/io/raw_secure_server_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698