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

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

Issue 11312122: Change List constructors. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload. Adapt code for List.fixedLength. Created 8 years 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 | « tests/standalone/io/regress-1925.dart ('k') | utils/archive/utils.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // The --short_socket_write option does not work with external server 7 // The --short_socket_write option does not work with external server
8 // www.google.dk. Add this to the test when we have secure server sockets. 8 // www.google.dk. Add this to the test when we have secure server sockets.
9 // See TODO below. 9 // See TODO below.
10 10
(...skipping 17 matching lines...) Expand all
28 tls.writeList(request_bytes, 20, request_bytes.length - 20); 28 tls.writeList(request_bytes, 20, request_bytes.length - 20);
29 }; 29 };
30 var useReadList; // Mutually recursive onData callbacks. 30 var useReadList; // Mutually recursive onData callbacks.
31 void useRead() { 31 void useRead() {
32 var data = tls.read(); 32 var data = tls.read();
33 var received = new String.fromCharCodes(data); 33 var received = new String.fromCharCodes(data);
34 chunks.add(received); 34 chunks.add(received);
35 tls.onData = useReadList; 35 tls.onData = useReadList;
36 } 36 }
37 useReadList = () { 37 useReadList = () {
38 var buffer = new List(2000); 38 var buffer = new List.fixedLength(2000);
39 int len = tls.readList(buffer, 0, 2000); 39 int len = tls.readList(buffer, 0, 2000);
40 var received = new String.fromCharCodes(buffer.getRange(0, len)); 40 var received = new String.fromCharCodes(buffer.getRange(0, len));
41 chunks.add(received); 41 chunks.add(received);
42 tls.onData = useRead; 42 tls.onData = useRead;
43 }; 43 };
44 tls.onData = useRead; 44 tls.onData = useRead;
45 tls.onClosed = () { 45 tls.onClosed = () {
46 String fullPage = Strings.concatAll(chunks); 46 String fullPage = Strings.concatAll(chunks);
47 Expect.isTrue(fullPage.contains('</body></html>')); 47 Expect.isTrue(fullPage.contains('</body></html>'));
48 tls.close(); 48 tls.close();
49 }; 49 };
50 } 50 }
OLDNEW
« no previous file with comments | « tests/standalone/io/regress-1925.dart ('k') | utils/archive/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698