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

Side by Side Diff: tests/standalone/io/file_test.dart

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // Dart test program for testing file I/O. 5 // Dart test program for testing file I/O.
6 6
7 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:isolate'; 10 import 'dart:isolate';
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 }); 145 });
146 146
147 // Immediate read should read 0 bytes. 147 // Immediate read should read 0 bytes.
148 input.listen( 148 input.listen(
149 (d) { 149 (d) {
150 for (int i = 0; i < d.length; ++i) { 150 for (int i = 0; i < d.length; ++i) {
151 Expect.equals(buffer[(i + position) % buffer.length], d[i]); 151 Expect.equals(buffer[(i + position) % buffer.length], d[i]);
152 } 152 }
153 position += d.length; 153 position += d.length;
154 }, 154 },
155 onError: (e) { 155 onError: (error) {
156 print('Error on input in testReadWriteStreamLargeFile'); 156 print('Error on input in testReadWriteStreamLargeFile');
157 print('with error $e'); 157 print('with error $error');
158 throw e; 158 var trace = getAttachedStackTrace(error);
159 if (trace != null) print("StackTrace: $trace");
160 throw error;
159 }, 161 },
160 onDone: () { 162 onDone: () {
161 Expect.equals(expectedLength, position); 163 Expect.equals(expectedLength, position);
162 testPipe(file, buffer) 164 testPipe(file, buffer)
163 .then((_) => file.delete()) 165 .then((_) => file.delete())
164 .then((_) { 166 .then((_) {
165 asyncTestDone('testReadWriteStreamLargeFile: main test'); 167 asyncTestDone('testReadWriteStreamLargeFile: main test');
166 }) 168 })
167 .catchError((e) { 169 .catchError((e) {
168 print('Exception while deleting ReadWriteStreamLargeFile file'); 170 print('Exception while deleting ReadWriteStreamLargeFile file');
169 print('Exception $e'); 171 print('Exception $e');
172 var trace = getAttachedStackTrace(e);
173 if (trace != null) print("StackTrace: $trace");
170 }); 174 });
171 }); 175 });
172 }); 176 });
173 } 177 }
174 178
175 static Future testPipe(File file, buffer) { 179 static Future testPipe(File file, buffer) {
176 String outputFilename = '${file.path}_copy'; 180 String outputFilename = '${file.path}_copy';
177 File outputFile = new File(outputFilename); 181 File outputFile = new File(outputFilename);
178 var input = file.openRead(); 182 var input = file.openRead();
179 var output = outputFile.openWrite(); 183 var output = outputFile.openWrite();
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1276 testDirectorySync(); 1280 testDirectorySync();
1277 testWriteStringUtf8(); 1281 testWriteStringUtf8();
1278 testWriteStringUtf8Sync(); 1282 testWriteStringUtf8Sync();
1279 }); 1283 });
1280 } 1284 }
1281 } 1285 }
1282 1286
1283 main() { 1287 main() {
1284 FileTest.testMain(); 1288 FileTest.testMain();
1285 } 1289 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_invalid_arguments_test.dart ('k') | tests/standalone/io/http_10_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698