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

Side by Side Diff: tests/standalone/io/socket_exception_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, 5 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 // Tests socket exceptions. 5 // Tests socket exceptions.
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:isolate"; 9 import "dart:isolate";
10 import "dart:io"; 10 import "dart:io";
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 Expect.isFalse(exceptionCaught); 88 Expect.isFalse(exceptionCaught);
89 Expect.isFalse(wrongExceptionCaught); 89 Expect.isFalse(wrongExceptionCaught);
90 try { 90 try {
91 List<int> buffer = new List<int>(10); 91 List<int> buffer = new List<int>(10);
92 client.add(buffer); 92 client.add(buffer);
93 } on StateError catch (ex) { 93 } on StateError catch (ex) {
94 exceptionCaught = true; 94 exceptionCaught = true;
95 } catch (ex) { 95 } catch (ex) {
96 wrongExceptionCaught = true; 96 wrongExceptionCaught = true;
97 } 97 }
98 Expect.isTrue(exceptionCaught); 98 Expect.isFalse(exceptionCaught);
99 Expect.isFalse(wrongExceptionCaught); 99 Expect.isFalse(wrongExceptionCaught);
100 100
101 server.close(); 101 server.close();
102 }); 102 });
103 }); 103 });
104 } 104 }
105 105
106 static void clientSocketDestroyNoErrorTest() { 106 static void clientSocketDestroyNoErrorTest() {
107 ServerSocket.bind("127.0.0.1", 0).then((server) { 107 ServerSocket.bind("127.0.0.1", 0).then((server) {
108 server.listen((socket) { 108 server.listen((socket) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 clientSocketAddCloseErrorTest(); 233 clientSocketAddCloseErrorTest();
234 clientSocketAddCloseResultErrorTest(); 234 clientSocketAddCloseResultErrorTest();
235 unknownHostTest(); 235 unknownHostTest();
236 } 236 }
237 } 237 }
238 238
239 main() { 239 main() {
240 SocketExceptionTest.testMain(); 240 SocketExceptionTest.testMain();
241 } 241 }
242 242
OLDNEW
« no previous file with comments | « tests/standalone/io/http_content_length_test.dart ('k') | tests/standalone/io/socket_upgrade_to_secure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698