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

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

Issue 18659004: Handle client end error in standalone/io/secure_socket_bad_data_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | 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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (bytesWritten == data.length) { 107 if (bytesWritten == data.length) {
108 baseSocket.write(data, 0, 300); 108 baseSocket.write(data, 0, 300);
109 socket.shutdown(SocketDirection.SEND); 109 socket.shutdown(SocketDirection.SEND);
110 } 110 }
111 break; 111 break;
112 case RawSocketEvent.READ_CLOSED: 112 case RawSocketEvent.READ_CLOSED:
113 completer.complete(null); 113 completer.complete(null);
114 break; 114 break;
115 default: throw "Unexpected event $event"; 115 default: throw "Unexpected event $event";
116 } 116 }
117 },
118 onError: (e) {
119 Expect.isTrue(e is IOException);
Anders Johnsen 2013/07/04 09:42:32 IOException? Not any higher-level error?
120 completer.complete(null);
117 }); 121 });
118 return completer.future; 122 return completer.future;
119 } 123 }
120 124
121 125
122 Future<List> connectClient(int port) => 126 Future<List> connectClient(int port) =>
123 RawSocket.connect(HOST_NAME, port) 127 RawSocket.connect(HOST_NAME, port)
124 .then((socket) => 128 .then((socket) =>
125 (hostnameInConnect ? RawSecureSocket.secure(socket) 129 (hostnameInConnect ? RawSecureSocket.secure(socket)
126 : RawSecureSocket.secure(socket, host: HOST_NAME)) 130 : RawSecureSocket.secure(socket, host: HOST_NAME))
(...skipping 18 matching lines...) Expand all
145 149
146 main() { 150 main() {
147 Path scriptDir = new Path(Platform.script).directoryPath; 151 Path scriptDir = new Path(Platform.script).directoryPath;
148 Path certificateDatabase = scriptDir.append('pkcert'); 152 Path certificateDatabase = scriptDir.append('pkcert');
149 SecureSocket.initialize(database: certificateDatabase.toNativePath(), 153 SecureSocket.initialize(database: certificateDatabase.toNativePath(),
150 password: 'dartdart', 154 password: 'dartdart',
151 useBuiltinRoots: false); 155 useBuiltinRoots: false);
152 test(false); 156 test(false);
153 test(true); 157 test(true);
154 } 158 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698