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

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

Issue 9487005: Move back to having File.open{Input,Output}Stream return the stream directly. (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 | « tests/standalone/src/FileInputStreamTest.dart ('k') | tests/standalone/src/FileTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/FileOutputStreamTest.dart
diff --git a/tests/standalone/src/FileOutputStreamTest.dart b/tests/standalone/src/FileOutputStreamTest.dart
index b9c51667ba15bc160151ca2138f7fc996c6ac7fe..95ef132d7b3157e57f3d6a3213dca9db06444bb4 100644
--- a/tests/standalone/src/FileOutputStreamTest.dart
+++ b/tests/standalone/src/FileOutputStreamTest.dart
@@ -20,7 +20,7 @@ void testOpenOutputStreamSync() {
String fileName = "${tempDirectory.path}/test";
File file = new File(fileName);
file.createSync();
- OutputStream x = file.openOutputStreamSync();
+ OutputStream x = file.openOutputStream();
x.write([65, 66, 67]);
x.close();
x.closeHandler = () {
@@ -30,39 +30,6 @@ void testOpenOutputStreamSync() {
}
-void testOpenOutputStreamAsync() {
- Directory tempDirectory = new Directory('');
-
- // Create a port for waiting on the final result of this test.
- ReceivePort done = new ReceivePort();
- done.receive((message, replyTo) {
- tempDirectory.delete();
- tempDirectory.deleteHandler = () {
- done.close();
- };
- });
-
- tempDirectory.createTemp();
- tempDirectory.createTempHandler = () {
- String fileName = "${tempDirectory.path}/test";
- File file = new File(fileName);
- file.create();
- file.createHandler = () {
- file.openOutputStream();
- file.outputStreamHandler = (OutputStream stream) {
- stream.close();
- stream.closeHandler = () {
- file.delete();
- };
- };
- };
- file.deleteHandler = () {
- done.toSendPort().send("done");
- };
- };
-}
-
-
void testOutputStreamNoPendingWrite() {
Directory tempDirectory = new Directory('');
@@ -81,16 +48,14 @@ void testOutputStreamNoPendingWrite() {
File file = new File(fileName);
file.create();
file.createHandler = () {
- file.openOutputStream();
- file.outputStreamHandler = (OutputStream stream) {
- final total = 100;
- var count = 0;
- stream.noPendingWriteHandler = () {
- stream.write([count++]);
- if (count == total) {
- stream.close();
- }
- };
+ OutputStream stream = file.openOutputStream();
+ final total = 100;
+ var count = 0;
+ stream.noPendingWriteHandler = () {
+ stream.write([count++]);
+ if (count == total) {
+ stream.close();
+ }
stream.closeHandler = () {
List buffer = new List<int>(total);
File fileSync = new File(fileName);
@@ -111,6 +76,5 @@ void testOutputStreamNoPendingWrite() {
main() {
testOpenOutputStreamSync();
- testOpenOutputStreamAsync();
testOutputStreamNoPendingWrite();
}
« no previous file with comments | « tests/standalone/src/FileInputStreamTest.dart ('k') | tests/standalone/src/FileTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698