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

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

Issue 12504006: Make IOSink implement StringSink (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed second round of review comments Created 7 years, 9 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 // 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 "dart:async"; 10 import "dart:async";
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 int bytesWritten = 0; 163 int bytesWritten = 0;
164 List<int> data = new List<int>(messageSize); 164 List<int> data = new List<int>(messageSize);
165 165
166 client.listen( 166 client.listen(
167 (buffer) { 167 (buffer) {
168 Expect.isTrue(bytesWritten == 0); 168 Expect.isTrue(bytesWritten == 0);
169 data.setRange(bytesRead, buffer.length, buffer); 169 data.setRange(bytesRead, buffer.length, buffer);
170 bytesRead += buffer.length; 170 bytesRead += buffer.length;
171 if (bytesRead == data.length) { 171 if (bytesRead == data.length) {
172 verifyTestData(data); 172 verifyTestData(data);
173 client.add(data); 173 client.writeBytes(data);
174 client.close(); 174 client.close();
175 } 175 }
176 }, 176 },
177 onDone: () { 177 onDone: () {
178 server.close(); 178 server.close();
179 }); 179 });
180 }); 180 });
181 181
182 SecureSocket.connect(HOST_NAME, server.port).then((socket) { 182 SecureSocket.connect(HOST_NAME, server.port).then((socket) {
183 int bytesRead = 0; 183 int bytesRead = 0;
184 int bytesWritten = 0; 184 int bytesWritten = 0;
185 List<int> dataSent = createTestData(); 185 List<int> dataSent = createTestData();
186 List<int> dataReceived = new List<int>(dataSent.length); 186 List<int> dataReceived = new List<int>(dataSent.length);
187 socket.add(dataSent); 187 socket.writeBytes(dataSent);
188 socket.close(); // Can also be delayed. 188 socket.close(); // Can also be delayed.
189 socket.listen( 189 socket.listen(
190 (List<int> buffer) { 190 (List<int> buffer) {
191 dataReceived.setRange(bytesRead, buffer.length, buffer); 191 dataReceived.setRange(bytesRead, buffer.length, buffer);
192 bytesRead += buffer.length; 192 bytesRead += buffer.length;
193 }, 193 },
194 onDone: () { 194 onDone: () {
195 verifyTestData(dataReceived); 195 verifyTestData(dataReceived);
196 socket.close(); 196 socket.close();
197 port.close(); 197 port.close();
(...skipping 11 matching lines...) Expand all
209 testArguments(); 209 testArguments();
210 testSimpleBind(); 210 testSimpleBind();
211 testInvalidBind(); 211 testInvalidBind();
212 testSimpleConnect(CERTIFICATE); 212 testSimpleConnect(CERTIFICATE);
213 testSimpleConnect("CN=localhost"); 213 testSimpleConnect("CN=localhost");
214 testSimpleConnectFail("not_a_nickname"); 214 testSimpleConnectFail("not_a_nickname");
215 testSimpleConnectFail("CN=notARealDistinguishedName"); 215 testSimpleConnectFail("CN=notARealDistinguishedName");
216 testServerListenAfterConnect(); 216 testServerListenAfterConnect();
217 testSimpleReadWrite(); 217 testSimpleReadWrite();
218 } 218 }
OLDNEW
« no previous file with comments | « tests/standalone/io/secure_multiple_client_server_test.dart ('k') | tests/standalone/io/secure_session_resume_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698