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

Unified Diff: tests/standalone/io/stream_pipe_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: 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
Index: tests/standalone/io/stream_pipe_test.dart
diff --git a/tests/standalone/io/stream_pipe_test.dart b/tests/standalone/io/stream_pipe_test.dart
index 75f7981af48fc54bfe139f3e3c597b05868be9f1..22080243d273281272acd09865ea4a316c7bdc56 100644
--- a/tests/standalone/io/stream_pipe_test.dart
+++ b/tests/standalone/io/stream_pipe_test.dart
@@ -6,11 +6,11 @@
// VMOptions=--short_socket_read
// VMOptions=--short_socket_write
// VMOptions=--short_socket_read --short_socket_write
-library ServerTest;
-import "package:expect/expect.dart";
import "dart:io";
-import "dart:isolate";
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
// Helper method to be able to run the test from the runtime
// directory, or the top directory.
@@ -61,8 +61,7 @@ bool compareFileContent(String fileName1,
testFileToFilePipe1() {
// Force test to timeout if one of the handlers is
// not called.
- ReceivePort donePort = new ReceivePort();
- donePort.receive((message, ignore) { donePort.close(); });
+ asyncStart();
String srcFileName =
getDataFilename("tests/standalone/io/readline_test1.dat");
@@ -77,7 +76,7 @@ testFileToFilePipe1() {
new File(dstFileName).deleteSync();
tempDir.deleteSync();
Expect.isTrue(result);
- donePort.toSendPort().send(null);
+ asyncEnd();
});
}
@@ -87,8 +86,7 @@ testFileToFilePipe1() {
testFileToFilePipe2() {
// Force test to timeout if one of the handlers is
// not called.
- ReceivePort donePort = new ReceivePort();
- donePort.receive((message, ignore) { donePort.close(); });
+ asyncStart();
String srcFileName =
getDataFilename("tests/standalone/io/readline_test1.dat");
@@ -120,7 +118,7 @@ testFileToFilePipe2() {
dst.closeSync();
dstFile.deleteSync();
tempDir.deleteSync();
- donePort.toSendPort().send(null);
+ asyncEnd();
});
});
}
@@ -130,8 +128,7 @@ testFileToFilePipe2() {
testFileToFilePipe3() {
// Force test to timeout if one of the handlers is
// not called.
- ReceivePort donePort = new ReceivePort();
- donePort.receive((message, ignore) { donePort.close(); });
+ asyncStart();
String srcFileName =
getDataFilename("tests/standalone/io/readline_test1.dat");
@@ -164,7 +161,7 @@ testFileToFilePipe3() {
dst.closeSync();
dstFile.deleteSync();
tempDir.deleteSync();
- donePort.toSendPort().send(null);
+ asyncEnd();
});
});
});
@@ -172,7 +169,9 @@ testFileToFilePipe3() {
main() {
+ asyncStart();
Anders Johnsen 2013/09/03 11:43:03 I fail to see the value of this one. It's not asyn
Søren Gjesse 2013/09/03 13:39:25 Nope, removed.
testFileToFilePipe1();
testFileToFilePipe2();
testFileToFilePipe3();
+ asyncEnd();
}
« no previous file with comments | « tests/standalone/io/socket_upgrade_to_secure_test.dart ('k') | tests/standalone/io/web_socket_protocol_processor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698