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

Unified Diff: tests/standalone/io/http_reuse_server_port_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/http_client_request_test.dart ('k') | tests/standalone/io/http_server_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_reuse_server_port_test.dart
diff --git a/tests/standalone/io/http_reuse_server_port_test.dart b/tests/standalone/io/http_reuse_server_port_test.dart
index 4da68026bb6500bf780d2b0952b5244ad70138ac..4829eb7e03bcc951199be1e7c550a93a99f57b09 100644
--- a/tests/standalone/io/http_reuse_server_port_test.dart
+++ b/tests/standalone/io/http_reuse_server_port_test.dart
@@ -7,10 +7,11 @@
// VMOptions=--short_socket_write
// VMOptions=--short_socket_read --short_socket_write
-import "package:expect/expect.dart";
import 'dart:async';
import 'dart:io';
-import 'dart:isolate';
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
Future<int> runServer(int port, int connections, bool clean) {
var completer = new Completer();
@@ -43,26 +44,26 @@ Future<int> runServer(int port, int connections, bool clean) {
void testReusePort() {
- var keepAlive = new ReceivePort();
+ asyncStart();
runServer(0, 10, true).then((int port) {
// Stress test the port reusing it 10 times.
Future.forEach(new List(10), (_) {
return runServer(port, 10, true);
}).then((_) {
- keepAlive.close();
+ asyncEnd();
});
});
}
void testUncleanReusePort() {
- var keepAlive = new ReceivePort();
+ asyncStart();
runServer(0, 10, false).then((int port) {
// Stress test the port reusing it 10 times.
Future.forEach(new List(10), (_) {
return runServer(port, 10, false);
}).then((_) {
- keepAlive.close();
+ asyncEnd();
});
});
}
« no previous file with comments | « tests/standalone/io/http_client_request_test.dart ('k') | tests/standalone/io/http_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698