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

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

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head Created 7 years, 10 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) 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 // 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:isolate"; 10 import "dart:isolate";
11 import "dart:io"; 11 import "dart:io";
12 12
13 void main() { 13 void main() {
14 ReceivePort keepAlive = new ReceivePort(); 14 ReceivePort keepAlive = new ReceivePort();
15 SecureSocket.initialize(); 15 SecureSocket.initialize();
16 List<String> chunks = <String>[]; 16 List<String> chunks = <String>[];
17 SecureSocket.connect("www.google.dk", 443).then((socket) { 17 SecureSocket.connect("www.google.dk", 443).then((socket) {
18 socket.add("GET / HTTP/1.0\r\nHost: www.google.dk\r\n\r\n".charCodes); 18 socket.add("GET / HTTP/1.0\r\nHost: www.google.dk\r\n\r\n".codeUnits);
19 socket.close(); 19 socket.close();
20 socket.listen( 20 socket.listen(
21 (List<int> data) { 21 (List<int> data) {
22 var received = new String.fromCharCodes(data); 22 var received = new String.fromCharCodes(data);
23 chunks.add(received); 23 chunks.add(received);
24 }, 24 },
25 onDone: () { 25 onDone: () {
26 String fullPage = chunks.join(); 26 String fullPage = chunks.join();
27 Expect.isTrue(fullPage.contains('</body></html>')); 27 Expect.isTrue(fullPage.contains('</body></html>'));
28 keepAlive.close(); 28 keepAlive.close();
29 }, 29 },
30 onError: (e) => Expect.fail("Unexpected error $e")); 30 onError: (e) => Expect.fail("Unexpected error $e"));
31 }); 31 });
32 } 32 }
OLDNEW
« no previous file with comments | « tests/standalone/io/secure_socket_bad_certificate_test.dart ('k') | tests/standalone/io/socket_close_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698