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

Side by Side Diff: tests/standalone/io/secure_socket_bad_certificate_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, 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) 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_write --short_socket_read 8 // VMOptions=--short_socket_write --short_socket_read
9 // The --short_socket_write option does not work with external server 9 // The --short_socket_write option does not work with external server
10 // www.google.dk. Add this to the test when we have secure server sockets. 10 // www.google.dk. Add this to the test when we have secure server sockets.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 Expect.isTrue(certificate.startValidity < new DateTime.now()); 42 Expect.isTrue(certificate.startValidity < new DateTime.now());
43 Expect.isTrue(certificate.endValidity > new DateTime.now()); 43 Expect.isTrue(certificate.endValidity > new DateTime.now());
44 return acceptCertificate; 44 return acceptCertificate;
45 }; 45 };
46 46
47 return SecureSocket.connect(host, 47 return SecureSocket.connect(host,
48 443, 48 443,
49 onBadCertificate: badCertificateCallback) 49 onBadCertificate: badCertificateCallback)
50 .then((socket) { 50 .then((socket) {
51 Expect.isTrue(acceptCertificate); 51 Expect.isTrue(acceptCertificate);
52 socket.add("GET / HTTP/1.0\r\nHost: $host\r\n\r\n".charCodes); 52 socket.add("GET / HTTP/1.0\r\nHost: $host\r\n\r\n".codeUnits);
53 socket.close(); 53 socket.close();
54 return socket.reduce(<int>[], (message, data) => message..addAll(data)) 54 return socket.reduce(<int>[], (message, data) => message..addAll(data))
55 .then((message) { 55 .then((message) {
56 String received = new String.fromCharCodes(message); 56 String received = new String.fromCharCodes(message);
57 Expect.isTrue(received.contains('</body></html>')); 57 Expect.isTrue(received.contains('</body></html>'));
58 }); 58 });
59 }).catchError((e) { 59 }).catchError((e) {
60 Expect.isFalse(acceptCertificate); 60 Expect.isFalse(acceptCertificate);
61 }); 61 });
62 } 62 }
OLDNEW
« no previous file with comments | « tests/standalone/io/secure_session_resume_test.dart ('k') | tests/standalone/io/secure_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698