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

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

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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/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();
});
+ });
});
}

Powered by Google App Engine
This is Rietveld 408576698