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

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

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/io/file_input_stream_test.dart ('k') | tests/standalone/io/file_non_ascii_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_invalid_arguments_test.dart
diff --git a/tests/standalone/io/file_invalid_arguments_test.dart b/tests/standalone/io/file_invalid_arguments_test.dart
index f335ac60fd8831555d6be30462a00367a961ce1b..f8196e6d4d46e284585aff05b99392a062141374 100644
--- a/tests/standalone/io/file_invalid_arguments_test.dart
+++ b/tests/standalone/io/file_invalid_arguments_test.dart
@@ -18,17 +18,15 @@ class FileTest {
var errors = 0;
var readListFuture = file.readList(buffer, offset, length);
- readListFuture.handleException((e) {
+ readListFuture.then((bytes) {
+ Expect.fail('read list invalid arguments');
+ }).catchError((e) {
errors++;
- Expect.isTrue(e is FileIOException);
- Expect.isTrue(e.toString().contains('Invalid arguments'));
+ Expect.isTrue(e.error is FileIOException);
+ Expect.isTrue(e.error.toString().contains('Invalid arguments'));
file.close().then((ignore) {
Expect.equals(1, errors);
});
- return true;
- });
- readListFuture.then((bytes) {
- Expect.fail('read list invalid arguments');
});
}
@@ -46,12 +44,10 @@ class FileTest {
var writeByteFuture = file.writeByte(value);
writeByteFuture.then((ignore) {
Expect.fail('write byte invalid argument');
- });
- writeByteFuture.handleException((s) {
- Expect.isTrue(s is FileIOException);
- Expect.isTrue(s.toString().contains('Invalid argument'));
+ }).catchError((s) {
+ Expect.isTrue(s.error is FileIOException);
+ Expect.isTrue(s.error.toString().contains('Invalid argument'));
file.close();
- return true;
});
}
@@ -69,12 +65,10 @@ class FileTest {
var writeListFuture = file.writeList(buffer, offset, bytes);
writeListFuture.then((ignore) {
Expect.fail('write list invalid argument');
- });
- writeListFuture.handleException((s) {
- Expect.isTrue(s is FileIOException);
- Expect.isTrue(s.toString().contains('Invalid arguments'));
+ }).catchError((s) {
+ Expect.isTrue(s.error is FileIOException);
+ Expect.isTrue(s.error.toString().contains('Invalid arguments'));
file.close();
- return true;
});
}
@@ -112,10 +106,10 @@ class FileTest {
main() {
FileTest.testReadListInvalidArgs(12, 0, 1);
- FileTest.testReadListInvalidArgs(new List(10), '0', 1);
- FileTest.testReadListInvalidArgs(new List(10), 0, '1');
+ FileTest.testReadListInvalidArgs(new List.fixedLength(10), '0', 1);
+ FileTest.testReadListInvalidArgs(new List.fixedLength(10), 0, '1');
FileTest.testWriteByteInvalidArgs('asdf');
FileTest.testWriteListInvalidArgs(12, 0, 1);
- FileTest.testWriteListInvalidArgs(new List(10), '0', 1);
- FileTest.testWriteListInvalidArgs(new List(10), 0, '1');
+ FileTest.testWriteListInvalidArgs(new List.fixedLength(10), '0', 1);
+ FileTest.testWriteListInvalidArgs(new List.fixedLength(10), 0, '1');
}
« no previous file with comments | « tests/standalone/io/file_input_stream_test.dart ('k') | tests/standalone/io/file_non_ascii_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698