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

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

Issue 2864443002: Revert "Throw when adding something to a closed sink and improve documentation." (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « sdk/lib/io/secure_socket.dart ('k') | tests/standalone/io/http_10_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // OtherResources=empty_file 7 // OtherResources=empty_file
8 // OtherResources=file_test.txt 8 // OtherResources=file_test.txt
9 // OtherResources=fixed_length_file 9 // OtherResources=fixed_length_file
10 // OtherResources=read_as_text.dat 10 // OtherResources=read_as_text.dat
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
981 } 981 }
982 982
983 // Tests stream exception handling after file was closed. 983 // Tests stream exception handling after file was closed.
984 static void testCloseExceptionStream() { 984 static void testCloseExceptionStream() {
985 asyncTestStarted(); 985 asyncTestStarted();
986 List<int> buffer = new List<int>(42); 986 List<int> buffer = new List<int>(42);
987 File file = new File(tempDirectory.path + "/out_close_exception_stream"); 987 File file = new File(tempDirectory.path + "/out_close_exception_stream");
988 file.createSync(); 988 file.createSync();
989 var output = file.openWrite(); 989 var output = file.openWrite();
990 output.close(); 990 output.close();
991 Expect.throws(() { 991 output.add(buffer); // Ignored.
992 output.add(buffer);
993 });
994 output.done.then((_) { 992 output.done.then((_) {
995 file.deleteSync(); 993 file.deleteSync();
996 asyncTestDone("testCloseExceptionStream"); 994 asyncTestDone("testCloseExceptionStream");
997 }); 995 });
998 } 996 }
999 997
1000 // Tests buffer out of bounds exception. 998 // Tests buffer out of bounds exception.
1001 static void testBufferOutOfBoundsException() { 999 static void testBufferOutOfBoundsException() {
1002 bool exceptionCaught = false; 1000 bool exceptionCaught = false;
1003 bool wrongExceptionCaught = false; 1001 bool wrongExceptionCaught = false;
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 testSetLastAccessedSyncDirectory(); 1675 testSetLastAccessedSyncDirectory();
1678 testDoubleAsyncOperation(); 1676 testDoubleAsyncOperation();
1679 asyncEnd(); 1677 asyncEnd();
1680 }); 1678 });
1681 } 1679 }
1682 } 1680 }
1683 1681
1684 main() { 1682 main() {
1685 FileTest.testMain(); 1683 FileTest.testMain();
1686 } 1684 }
OLDNEW
« no previous file with comments | « sdk/lib/io/secure_socket.dart ('k') | tests/standalone/io/http_10_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698