| Index: tests/standalone/io/file_stream_test.dart
|
| diff --git a/tests/standalone/io/file_stream_test.dart b/tests/standalone/io/file_stream_test.dart
|
| index e1a9105485fc0256deb26712fb7cc2deb18c4787..f5e5503b6adcc428b37954cd36eef92c69a28b36 100644
|
| --- a/tests/standalone/io/file_stream_test.dart
|
| +++ b/tests/standalone/io/file_stream_test.dart
|
| @@ -12,26 +12,26 @@ void testPauseResumeCancelStream() {
|
| asyncStart();
|
| Directory.systemTemp.createTemp('dart_file_stream').then((d) {
|
| var file = new File("${d.path}/file");
|
| - new File(Platform.executable).openRead().pipe(file.openWrite())
|
| - .then((_) {
|
| - var subscription;
|
| - subscription = file.openRead().listen((data) {
|
| - subscription.pause();
|
| - subscription.resume();
|
| - void close() {
|
| - d.deleteSync(recursive: true);
|
| - asyncEnd();
|
| - }
|
| - var future = subscription.cancel();
|
| - if (future != null) {
|
| - future.whenComplete(close);
|
| - } else {
|
| - close();
|
| - }
|
| - }, onDone: () {
|
| - Expect.fail('the stream was canceled, onDone should not happen');
|
| - });
|
| + new File(Platform.executable).openRead().pipe(file.openWrite()).then((_) {
|
| + var subscription;
|
| + subscription = file.openRead().listen((data) {
|
| + subscription.pause();
|
| + subscription.resume();
|
| + void close() {
|
| + d.deleteSync(recursive: true);
|
| + asyncEnd();
|
| + }
|
| +
|
| + var future = subscription.cancel();
|
| + if (future != null) {
|
| + future.whenComplete(close);
|
| + } else {
|
| + close();
|
| + }
|
| + }, onDone: () {
|
| + Expect.fail('the stream was canceled, onDone should not happen');
|
| });
|
| + });
|
| });
|
| }
|
|
|
| @@ -39,15 +39,14 @@ void testStreamIsEmpty() {
|
| asyncStart();
|
| Directory.systemTemp.createTemp('dart_file_stream').then((d) {
|
| var file = new File("${d.path}/file");
|
| - new File(Platform.executable).openRead().pipe(file.openWrite())
|
| - .then((_) {
|
| - // isEmpty will cancel the stream after first data event.
|
| - file.openRead().isEmpty.then((empty) {
|
| - Expect.isFalse(empty);
|
| - d.deleteSync(recursive: true);
|
| - asyncEnd();
|
| - });
|
| + new File(Platform.executable).openRead().pipe(file.openWrite()).then((_) {
|
| + // isEmpty will cancel the stream after first data event.
|
| + file.openRead().isEmpty.then((empty) {
|
| + Expect.isFalse(empty);
|
| + d.deleteSync(recursive: true);
|
| + asyncEnd();
|
| });
|
| + });
|
| });
|
| }
|
|
|
|
|