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

Side by Side Diff: tests/standalone/src/SocketExceptionTest.dart

Issue 8413034: New OutputStream interface (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 class SocketExceptionTest { 7 class SocketExceptionTest {
8 8
9 static final PORT = 0; 9 static final PORT = 0;
10 static final HOST = "127.0.0.1"; 10 static final HOST = "127.0.0.1";
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } catch (SocketIOException ex) { 97 } catch (SocketIOException ex) {
98 exceptionCaught = true; 98 exceptionCaught = true;
99 } catch (Exception ex) { 99 } catch (Exception ex) {
100 wrongExceptionCaught = true; 100 wrongExceptionCaught = true;
101 } 101 }
102 Expect.equals(true, exceptionCaught); 102 Expect.equals(true, exceptionCaught);
103 Expect.equals(true, !wrongExceptionCaught); 103 Expect.equals(true, !wrongExceptionCaught);
104 exceptionCaught = false; 104 exceptionCaught = false;
105 try { 105 try {
106 List<int> buffer = new List<int>(42); 106 List<int> buffer = new List<int>(42);
107 bool readDone = output.write(buffer, 0, 12, null); 107 output.writeFrom(buffer, 0, 12);
108 } catch (SocketIOException ex) { 108 } catch (SocketIOException ex) {
109 exceptionCaught = true; 109 exceptionCaught = true;
110 } catch (Exception ex) { 110 } catch (Exception ex) {
111 wrongExceptionCaught = true; 111 wrongExceptionCaught = true;
112 } 112 }
113 Expect.equals(true, exceptionCaught); 113 Expect.equals(true, exceptionCaught);
114 Expect.equals(true, !wrongExceptionCaught); 114 Expect.equals(true, !wrongExceptionCaught);
115 115
116 server.close(); 116 server.close();
117 } 117 }
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 static void testMain() { 179 static void testMain() {
180 serverSocketExceptionTest(); 180 serverSocketExceptionTest();
181 clientSocketExceptionTest(); 181 clientSocketExceptionTest();
182 indexOutOfRangeExceptionTest(); 182 indexOutOfRangeExceptionTest();
183 } 183 }
184 } 184 }
185 185
186 main() { 186 main() {
187 SocketExceptionTest.testMain(); 187 SocketExceptionTest.testMain();
188 } 188 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698