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

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

Issue 8883017: Split File into File and RandomAccessFile. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 9 years 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/FileInvalidArgumentsTest.dart
diff --git a/tests/standalone/src/FileInvalidArgumentsTest.dart b/tests/standalone/src/FileInvalidArgumentsTest.dart
index 484dbcc8ebc64035408a59050b6b71ca0fd1aac9..fc6ffe36963a3fa79cf4fa0ee9c1e549ed71fa12 100644
--- a/tests/standalone/src/FileInvalidArgumentsTest.dart
+++ b/tests/standalone/src/FileInvalidArgumentsTest.dart
@@ -60,29 +60,9 @@ class FileTest {
file.create();
}
- static void testCloseNonOpened() {
- var file = new File(0);
- try {
- file.closeSync();
- Expect.fail('exception expected');
- } catch (var e) {
- Expect.isTrue(e is FileIOException);
- Expect.isTrue(e.toString().contains('Cannot close file'));
- }
-
- file.errorHandler = (s) {
- Expect.isTrue(s.contains('Cannot close file'));
- };
- file.closeHandler = () {
- Expect.fail('close non-opened file');
- };
- file.close();
- }
-
static void testReadListInvalidArgs(buffer, offset, length) {
String filename = getFilename("tests/vm/data/fixed_length_file");
- var file = new File(filename);
- file.openSync();
+ var file = (new File(filename)).openSync();
try {
file.readListSync(buffer, offset, length);
Expect.fail('exception expected');
@@ -108,8 +88,7 @@ class FileTest {
static void testWriteByteInvalidArgs(value) {
String filename = getFilename("tests/vm/data/fixed_length_file");
- var file = new File(filename + "_out");
- file.openSync(true);
+ var file = (new File(filename + "_out")).openSync(true);
try {
file.writeByteSync(value);
Expect.fail('exception expected');
@@ -135,8 +114,7 @@ class FileTest {
static void testWriteListInvalidArgs(buffer, offset, bytes) {
String filename = getFilename("tests/vm/data/fixed_length_file");
- var file = new File(filename + "_out");
- file.openSync(true);
+ var file = (new File(filename + "_out")).openSync(true);
try {
file.writeListSync(buffer, offset, bytes);
Expect.fail('exception expected');
@@ -215,7 +193,6 @@ main() {
FileTest.testOpenInvalidArgs('name', 0);
FileTest.testExistsInvalidArgs(0);
FileTest.testCreateInvalidArgs(0);
- FileTest.testCloseNonOpened();
FileTest.testReadListInvalidArgs(12, 0, 1);
FileTest.testReadListInvalidArgs(new List(10), '0', 1);
FileTest.testReadListInvalidArgs(new List(10), 0, '1');
« 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