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

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

Issue 11419138: Rename TlsSocket to SecureSocket, and all other Tls... items to Secure.... (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4 //
5 // VMOptions=
6 // VMOptions=--short_socket_read
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.
9 // See TODO below.
10
11 #import("dart:isolate");
12 #import("dart:io");
13
14 void main() {
15 var testPkcertDatabase =
16 new Path.fromNative(new Options().script).directoryPath.append('pkcert/');
17 TlsSocket.setCertificateDatabase(testPkcertDatabase.toNativePath());
18 // TODO(3593): Use a Dart HTTPS server for this test using TLS server sockets.
19 // When we use a Dart HTTPS server, allow --short_socket_write. The flag
20 // causes fragmentation of the client hello message, which doesn't seem to
21 // work with www.google.dk.
22 var tls = new TlsSocket("www.google.dk", 443);
23 List<String> chunks = <String>[];
24 var input = tls.inputStream;
25 var output = tls.outputStream;
26
27 output.write("GET / HTTP/1.0\r\nHost: www.google.dk\r\n\r\n".charCodes);
28 output.close();
29 input.onData = () {
30 chunks.add(new String.fromCharCodes(input.read()));
31 };
32 input.onClosed = () {
33 String fullPage = Strings.concatAll(chunks);
34 Expect.isTrue(fullPage.contains('</body></html>'));
35 };
36 }
OLDNEW
« tests/standalone/io/secure_stream_test.dart ('K') | « tests/standalone/io/tls_socket_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698