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

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

Issue 20036002: Don't throw exceptions when adding to a IOSink(StreamSink) after close. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Document the behaviour. Created 7 years, 4 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
« no previous file with comments | « sdk/lib/io/io_sink.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 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:collection'; 9 import 'dart:collection';
10 import 'dart:io'; 10 import 'dart:io';
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 797
798 // Tests stream exception handling after file was closed. 798 // Tests stream exception handling after file was closed.
799 static void testCloseExceptionStream() { 799 static void testCloseExceptionStream() {
800 asyncTestStarted(); 800 asyncTestStarted();
801 List<int> buffer = new List<int>(42); 801 List<int> buffer = new List<int>(42);
802 File file = 802 File file =
803 new File(tempDirectory.path + "/out_close_exception_stream"); 803 new File(tempDirectory.path + "/out_close_exception_stream");
804 file.createSync(); 804 file.createSync();
805 var output = file.openWrite(); 805 var output = file.openWrite();
806 output.close(); 806 output.close();
807 Expect.throws(() => output.add(buffer)); 807 output.add(buffer); // Ignored.
808 output.done.then((_) { 808 output.done.then((_) {
809 file.deleteSync(); 809 file.deleteSync();
810 asyncTestDone("testCloseExceptionStream"); 810 asyncTestDone("testCloseExceptionStream");
811 }); 811 });
812 } 812 }
813 813
814 // Tests buffer out of bounds exception. 814 // Tests buffer out of bounds exception.
815 static void testBufferOutOfBoundsException() { 815 static void testBufferOutOfBoundsException() {
816 bool exceptionCaught = false; 816 bool exceptionCaught = false;
817 bool wrongExceptionCaught = false; 817 bool wrongExceptionCaught = false;
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 testWriteStringUtf8Sync(); 1331 testWriteStringUtf8Sync();
1332 testRename(); 1332 testRename();
1333 testRenameSync(); 1333 testRenameSync();
1334 }); 1334 });
1335 } 1335 }
1336 } 1336 }
1337 1337
1338 main() { 1338 main() {
1339 FileTest.testMain(); 1339 FileTest.testMain();
1340 } 1340 }
OLDNEW
« no previous file with comments | « sdk/lib/io/io_sink.dart ('k') | tests/standalone/io/http_10_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698