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

Unified Diff: tests/standalone/io/secure_no_builtin_roots_database_test.dart

Issue 23583002: Make dart:io SecureSocket builtin root certificate test more robust, merge test files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: tests/standalone/io/secure_no_builtin_roots_database_test.dart
diff --git a/tests/standalone/io/secure_no_builtin_roots_database_test.dart b/tests/standalone/io/secure_no_builtin_roots_database_test.dart
deleted file mode 100644
index 7f1276bf8097031dac44ddcd045e6c9d58c1191b..0000000000000000000000000000000000000000
--- a/tests/standalone/io/secure_no_builtin_roots_database_test.dart
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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 "package:expect/expect.dart";
-import "package:path/path.dart";
-import "dart:io";
-import "dart:isolate";
-import "dart:async";
-
-void testGoogleUrl() {
- // We need to use an external server here because it is backed by a
- // built-in root certificate authority.
- InternetAddress.lookup('www.google.com').then((_) {
- ReceivePort keepAlive = new ReceivePort();
- HttpClient client = new HttpClient();
- client.getUrl(Uri.parse('https://www.google.com'))
- .then((request) => request.close())
- .then((response) => Expect.fail("Unexpected successful connection"))
- .catchError((error) {
- Expect.isTrue(error is HandshakeException);
- keepAlive.close();
- client.close();
- });
- },
- onError: (e) {
- Expect.isTrue(e is SocketException);
- });
-}
-
-void InitializeSSL() {
- // If the built-in root certificates aren't loaded, the connection
- // should signal an error. Even when an external database is loaded,
- // they should not be loaded.
- var certificateDatabase = join(dirname(Platform.script), 'pkcert');
- SecureSocket.initialize(database: certificateDatabase,
- password: 'dartdart',
- useBuiltinRoots: false);
-}
-
-void main() {
- InitializeSSL();
- testGoogleUrl();
-}

Powered by Google App Engine
This is Rietveld 408576698