| Index: tests/standalone/io/secure_builtin_roots_test.dart
|
| diff --git a/tests/standalone/io/secure_builtin_roots_test.dart b/tests/standalone/io/secure_builtin_roots_test.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..176f6ee83762fe5fd30aca4a16f1f50d8f0b3ae2
|
| --- /dev/null
|
| +++ b/tests/standalone/io/secure_builtin_roots_test.dart
|
| @@ -0,0 +1,42 @@
|
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +import "dart:io";
|
| +import "dart:uri";
|
| +import "dart:isolate";
|
| +
|
| +void testGoogleUrl() {
|
| + HttpClient client = new HttpClient();
|
| +
|
| + void testUrl(String url) {
|
| + var requestUri = new Uri.fromString(url);
|
| + var conn = client.getUrl(requestUri);
|
| +
|
| + conn.onRequest = (HttpClientRequest request) {
|
| + request.outputStream.close();
|
| + };
|
| + conn.onResponse = (HttpClientResponse response) {
|
| + Expect.isTrue(response.statusCode < 500);
|
| + Expect.isTrue(response.statusCode != 404);
|
| + response.inputStream.onData = () {
|
| + response.inputStream.read();
|
| + };
|
| + response.inputStream.onClosed = () {
|
| + client.shutdown();
|
| + };
|
| + };
|
| + conn.onError = (error) => Expect.fail("Unexpected IO error $error");
|
| + }
|
| +
|
| + testUrl('https://www.google.com');
|
| +}
|
| +
|
| +void InitializeSSL() {
|
| + SecureSocket.initialize();
|
| +}
|
| +
|
| +void main() {
|
| + InitializeSSL();
|
| + testGoogleUrl();
|
| +}
|
|
|